dix: use GetMaster in PickPointer and PickKeyboard.

GetMaster is more reliable than GetPairedDevice, it always returns the
keyboard/pointer if desired, even if the wrong device was passed in.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2009-06-03 12:18:17 +10:00
parent a1d1dd06f8
commit 08fd2ae652

View File

@ -5733,8 +5733,7 @@ PickPointer(ClientPtr client)
GrabPtr grab = it->deviceGrab.grab; GrabPtr grab = it->deviceGrab.grab;
if (grab && grab->grabtype == GRABTYPE_CORE && SameClient(grab, client)) if (grab && grab->grabtype == GRABTYPE_CORE && SameClient(grab, client))
{ {
if (!IsPointerDevice(it)) it = GetMaster(it, MASTER_POINTER);
it = GetPairedDevice(it);
return it; /* Always return a core grabbed device */ return it; /* Always return a core grabbed device */
} }
} }
@ -5763,7 +5762,7 @@ DeviceIntPtr
PickKeyboard(ClientPtr client) PickKeyboard(ClientPtr client)
{ {
DeviceIntPtr ptr = PickPointer(client); DeviceIntPtr ptr = PickPointer(client);
DeviceIntPtr kbd = ptr->spriteInfo->paired; DeviceIntPtr kbd = GetMaster(ptr, MASTER_KEYBOARD);
if (!kbd) if (!kbd)
{ {