summaryrefslogtreecommitdiff
path: root/Xi
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2008-06-15 10:01:28 +0930
committerPeter Hutterer <peter@cs.unisa.edu.au>2008-06-15 11:47:24 +0930
commit8c9234a163eceda2abc0a2523e0f5587ea399935 (patch)
tree92281fefa55c7201a312a78aae37ea24385c51a9 /Xi
parentd894e86aa5bea81147c4a7ad8630bcfb04156792 (diff)
Xi: avoid double button mapping.
Button events were mapped once in GetPointerEvents and then again in UpdateDeviceState. While it might make sense to just fix up UpdateDeviceState, it turns out to be better to leave the raw button number in the event because DGA reports raw device events without button translation, and so when it calls UpdateDeviceState, the button down counts get scrambled and buttons get stuck down. See also: http://lists.freedesktop.org/archives/xorg/2008-June/036201.html Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au>
Diffstat (limited to 'Xi')
-rw-r--r--Xi/exevents.c13
1 files changed, 9 insertions, 4 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