[PATCH 2/2] xkb: only post a XTest release if the XTest device has the button down
Peter Hutterer
peter.hutterer at who-t.net
Tue Dec 4 23:24:30 PST 2012
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
xkb/xkbAccessX.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/xkb/xkbAccessX.c b/xkb/xkbAccessX.c
index 9631502..13051e0 100644
--- a/xkb/xkbAccessX.c
+++ b/xkb/xkbAccessX.c
@@ -732,8 +732,13 @@ ProcessPointerEvent(InternalEvent *ev, DeviceIntPtr mouse)
if (rc != Success)
ErrorF("[xkb] bad sourceid '%d' on button release event.\n",
event->sourceid);
- else if (!IsXTestDevice(source, GetMaster(dev, MASTER_POINTER)))
- XkbFakeDeviceButton(dev, FALSE, event->detail.key);
+ else if (!IsXTestDevice(source, GetMaster(dev, MASTER_POINTER))) {
+ DeviceIntPtr xtest_device;
+
+ xtest_device = GetXTestDevice(GetMaster(dev, MASTER_POINTER));
+ if (button_is_down(xtest_device, ev->device_event.detail.button, BUTTON_PROCESSED))
+ XkbFakeDeviceButton(dev, FALSE, event->detail.key);
+ }
}
if (xkbi)
--
1.7.11.7
More information about the xorg-devel
mailing list