From f00cf7675164bb984ef310412f9e09582813adb1 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 2 Jun 2009 10:23:21 +1000 Subject: [PATCH] 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. --- dix/events.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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;