dix: get the paired keyboard for a passive grab (ProcGrabButton).
Taking the VCK is only correct if no physical device is connected, and even then it's not really a good idea.
This commit is contained in:
parent
a0b87f87fb
commit
b8abeaf74e
|
@ -5326,6 +5326,7 @@ ProcGrabButton(ClientPtr client)
|
||||||
REQUEST(xGrabButtonReq);
|
REQUEST(xGrabButtonReq);
|
||||||
CursorPtr cursor;
|
CursorPtr cursor;
|
||||||
GrabPtr grab;
|
GrabPtr grab;
|
||||||
|
DeviceIntPtr pointer, modifierDevice;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xGrabButtonReq);
|
REQUEST_SIZE_MATCH(xGrabButtonReq);
|
||||||
|
@ -5381,11 +5382,15 @@ ProcGrabButton(ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pointer = PickPointer(client);
|
||||||
|
modifierDevice = GetPairedKeyboard(pointer);
|
||||||
|
if (!modifierDevice)
|
||||||
|
modifierDevice = inputInfo.keyboard;
|
||||||
|
|
||||||
grab = CreateGrab(client->index, PickPointer(client), pWin,
|
grab = CreateGrab(client->index, pointer, pWin,
|
||||||
(Mask)stuff->eventMask, (Bool)stuff->ownerEvents,
|
(Mask)stuff->eventMask, (Bool)stuff->ownerEvents,
|
||||||
(Bool) stuff->keyboardMode, (Bool)stuff->pointerMode,
|
(Bool) stuff->keyboardMode, (Bool)stuff->pointerMode,
|
||||||
inputInfo.keyboard, stuff->modifiers, ButtonPress,
|
modifierDevice, stuff->modifiers, ButtonPress,
|
||||||
stuff->button, confineTo, cursor);
|
stuff->button, confineTo, cursor);
|
||||||
if (!grab)
|
if (!grab)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user