aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/xkb
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/xkb')
-rw-r--r--xorg-server/xkb/xkbAccessX.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/xorg-server/xkb/xkbAccessX.c b/xorg-server/xkb/xkbAccessX.c
index 21df85d94..13051e034 100644
--- a/xorg-server/xkb/xkbAccessX.c
+++ b/xorg-server/xkb/xkbAccessX.c
@@ -723,23 +723,27 @@ ProcessPointerEvent(InternalEvent *ev, DeviceIntPtr mouse)
changed |= XkbPointerButtonMask;
}
else if (event->type == ET_ButtonRelease) {
- if (xkbi) {
- xkbi->lockedPtrButtons &= ~(1 << (event->detail.key & 0x7));
-
- if (IsMaster(dev)) {
- DeviceIntPtr source;
- int rc;
-
- rc = dixLookupDevice(&source, event->sourceid, serverClient,
- DixWriteAccess);
- if (rc != Success)
- ErrorF("[xkb] bad sourceid '%d' on button release event.\n",
- event->sourceid);
- else if (!IsXTestDevice(source, GetMaster(dev, MASTER_POINTER)))
+ if (IsMaster(dev)) {
+ DeviceIntPtr source;
+ int rc;
+
+ rc = dixLookupDevice(&source, event->sourceid, serverClient,
+ DixWriteAccess);
+ if (rc != Success)
+ ErrorF("[xkb] bad sourceid '%d' on button release event.\n",
+ event->sourceid);
+ 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)
+ xkbi->lockedPtrButtons &= ~(1 << (event->detail.key & 0x7));
+
changed |= XkbPointerButtonMask;
}