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:
Peter Hutterer 2007-08-07 12:32:46 +09:30
parent a0b87f87fb
commit b8abeaf74e

View File

@ -5326,6 +5326,7 @@ ProcGrabButton(ClientPtr client)
REQUEST(xGrabButtonReq);
CursorPtr cursor;
GrabPtr grab;
DeviceIntPtr pointer, modifierDevice;
int rc;
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,
(Bool) stuff->keyboardMode, (Bool)stuff->pointerMode,
inputInfo.keyboard, stuff->modifiers, ButtonPress,
modifierDevice, stuff->modifiers, ButtonPress,
stuff->button, confineTo, cursor);
if (!grab)
return BadAlloc;