summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-12-04 15:28:14 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2012-12-05 17:22:28 +1000
commit5daa442fe15d9a87112a2def673c99a5f2506dcf (patch)
treedd8dfcd09771efa54f87ccb040ad514d6769b395
parentc4fee9d2ecd6fdd4c05b04c9f02b23f10f2938b8 (diff)
xkb: only post a XTest release if the XTest device has the button down
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--xkb/xkbAccessX.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/xkb/xkbAccessX.c b/xkb/xkbAccessX.c
index 963150294..13051e034 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)