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.
This commit is contained in:
Peter Hutterer 2009-06-02 10:23:21 +10:00
parent 1cd7ed75d9
commit f00cf76751

View File

@ -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;