dix: if a client has a core grab, return the grab device on QueryPointer.

The correct thing would be to return the ClientPointer. However, if the client
for some reason has a core grab on another device (e.g. as result of a passive
grab), return the coordinates of the grabbed device instead.

This makes the use of nautilus a bit saner.
This commit is contained in:
Peter Hutterer 2008-01-18 21:44:22 +10:30
parent cd2ad4c2ed
commit 6492d513c0

View File

@ -5595,7 +5595,8 @@ ProcQueryPointer(ClientPtr client)
xQueryPointerReply rep;
WindowPtr pWin, t;
DeviceIntPtr mouse = PickPointer(client);
SpritePtr pSprite = mouse->spriteInfo->sprite;
DeviceIntPtr dev;
SpritePtr pSprite;
int rc;
REQUEST(xResourceReq);
REQUEST_SIZE_MATCH(xResourceReq);
@ -5607,6 +5608,19 @@ ProcQueryPointer(ClientPtr client)
if (rc != Success)
return rc;
for (dev = inputInfo.devices; dev; dev = dev->next)
{
if (dev->isMaster && IsPointerDevice(dev) &&
dev->deviceGrab.grab && dev->deviceGrab.grab->coreGrab &&
SameClient(dev->deviceGrab.grab, client))
{
/* special case, we have a grab on the device so we need to return
* this one */
mouse = dev;
}
}
pSprite = mouse->spriteInfo->sprite;
if (mouse->valuator->motionHintWindow)
MaybeStopHint(mouse, client);
rep.type = X_Reply;