summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-06-02 10:23:21 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-06-02 16:02:31 +1000
commitf00cf7675164bb984ef310412f9e09582813adb1 (patch)
tree7f037b9081a4924af6d224057569225e7a1955f0
parent1cd7ed75d903b5b0ea4e1070d2c26f4f931bdec7 (diff)
dix: get the current MD keyboard for the grab modifier state.
A passive XI2 grab always uses the paired master device as a modifier device. After issuing a passive grab, the slave may be reattached to a different master and hence the modifier device may change.
-rw-r--r--dix/events.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/dix/events.c b/dix/events.c
index 52c5e6c38..13ef5b871 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -3417,7 +3417,17 @@ CheckPassiveGrabsOnWindow(
gdev = GetPairedDevice(device);
else
gdev = device;
+ } else if (grab->grabtype == GRABTYPE_XI2)
+ {
+ /* if the device is an attached slave device, gdev must be the
+ * attached master keyboard. Since the slave may have been
+ * reattached after the grab, the modifier device may not be the
+ * same. */
+ if (!IsMaster(grab->device) && device->u.master)
+ gdev = GetMaster(device, MASTER_KEYBOARD);
}
+
+
if (gdev && gdev->key)
xkbi= gdev->key->xkbInfo;
tempGrab.modifierDevice = grab->modifierDevice;