dix: move grab device assignment into GRABTYPE_CORE block.
grab->type is the device type and XI2 types overlap with core events (being less than GenericEvent). Thus, for passive grabs the grab device would be overwritten with whatever device was activating it. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
18ae486708
commit
b3e4810a28
21
dix/events.c
21
dix/events.c
|
@ -3461,6 +3461,17 @@ CheckPassiveGrabsOnWindow(
|
|||
event->corestate &= 0x1f00;
|
||||
event->corestate |= tempGrab.modifiersDetail.exact & (~0x1f00);
|
||||
grabinfo = &device->deviceGrab;
|
||||
/* In some cases a passive core grab may exist, but the client
|
||||
* already has a core grab on some other device. In this case we
|
||||
* must not get the grab, otherwise we may never ungrab the
|
||||
* device.
|
||||
*/
|
||||
|
||||
if (grab->grabtype == GRABTYPE_CORE)
|
||||
{
|
||||
DeviceIntPtr other;
|
||||
BOOL interfering = FALSE;
|
||||
|
||||
/* A passive grab may have been created for a different device
|
||||
than it is assigned to at this point in time.
|
||||
Update the grab's device and modifier device to reflect the
|
||||
|
@ -3474,16 +3485,6 @@ CheckPassiveGrabsOnWindow(
|
|||
grab->modifierDevice = GetPairedDevice(device);
|
||||
}
|
||||
|
||||
/* In some cases a passive core grab may exist, but the client
|
||||
* already has a core grab on some other device. In this case we
|
||||
* must not get the grab, otherwise we may never ungrab the
|
||||
* device.
|
||||
*/
|
||||
|
||||
if (grab->grabtype == GRABTYPE_CORE)
|
||||
{
|
||||
DeviceIntPtr other;
|
||||
BOOL interfering = FALSE;
|
||||
for (other = inputInfo.devices; other; other = other->next)
|
||||
{
|
||||
GrabPtr othergrab = other->deviceGrab.grab;
|
||||
|
|
Loading…
Reference in New Issue
Block a user