summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Xi/exevents.c13
-rw-r--r--dix/getevents.c2
2 files changed, 10 insertions, 5 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c
index 725c57835..6f88b57f3 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1066,9 +1066,11 @@ ProcessOtherEvent(xEventPtr xE, DeviceIntPtr device, int count)
(key == device->deviceGrab.activatingKey))
deactivateDeviceGrab = TRUE;
} else if (xE->u.u.type == DeviceButtonPress) {
- xE->u.u.detail = key;
- if (xE->u.u.detail == 0)
+ xE->u.u.detail = b->map[key];
+ if (xE->u.u.detail == 0) {
+ xE->u.u.detail = key;
return;
+ }
if (!grab && CheckDeviceGrabs(device, xE, 0, count))
{
/* if a passive grab was activated, the event has been sent
@@ -1077,9 +1079,11 @@ ProcessOtherEvent(xEventPtr xE, DeviceIntPtr device, int count)
}
} else if (xE->u.u.type == DeviceButtonRelease) {
- xE->u.u.detail = key;
- if (xE->u.u.detail == 0)
+ xE->u.u.detail = b->map[key];
+ if (xE->u.u.detail == 0) {
+ xE->u.u.detail = key;
return;
+ }
if (!b->state && device->deviceGrab.fromPassiveGrab)
deactivateDeviceGrab = TRUE;
}
@@ -1094,6 +1098,7 @@ ProcessOtherEvent(xEventPtr xE, DeviceIntPtr device, int count)
if (deactivateDeviceGrab == TRUE)
(*device->deviceGrab.DeactivateGrab) (device);
+ xE->u.u.detail = key;
}
_X_EXPORT int
diff --git a/dix/getevents.c b/dix/getevents.c
index 5227c54ec..b00bc11ca 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -1030,7 +1030,7 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons,
kbp->type = DeviceButtonPress;
else if (type == ButtonRelease)
kbp->type = DeviceButtonRelease;
- kbp->detail = pDev->button->map[buttons];
+ kbp->detail = buttons;
}
kbp->root_x = cx; /* root_x/y always in screen coords */