summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter@cs.unisa.edu.au>2008-01-18 21:44:22 +1030
committerPeter Hutterer <peter@cs.unisa.edu.au>2008-01-18 21:44:22 +1030
commit6492d513c0022d70f838d1b2561442c7a41e401f (patch)
tree8e2ecb207381781b6153c97c5bf4b7682fc383b0
parentcd2ad4c2ed58b49cee085174e77c242048159321 (diff)
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.
-rw-r--r--dix/events.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/dix/events.c b/dix/events.c
index f4925e494..f955d8152 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -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;