summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2011-08-31 00:46:52 +0200
committerPeter Hutterer <peter.hutterer@who-t.net>2011-09-27 11:56:27 +1000
commitf52d5cd374563544dafe29587411f345e31bbdf8 (patch)
treef81be33c29659c1b2754362bb9558d0c7df3bdc8
parent24823f1ab0f16e0815ef44340894537dc4babf6a (diff)
Xi: Fix passive XI2 ungrabs on XIAll[Master]Devices
The corresponding DeviceIntPtr wasn't being gotten properly, resulting in BadDevice from dixLookupDevice(). Signed-off-by: Carlos Garnacho <carlosg@gnome.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--Xi/xipassivegrab.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c
index ae4343344..5cdd8aca6 100644
--- a/Xi/xipassivegrab.c
+++ b/Xi/xipassivegrab.c
@@ -261,9 +261,16 @@ ProcXIPassiveUngrabDevice(ClientPtr client)
REQUEST(xXIPassiveUngrabDeviceReq);
REQUEST_AT_LEAST_SIZE(xXIPassiveUngrabDeviceReq);
- rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess);
- if (rc != Success)
- return rc;
+ if (stuff->deviceid == XIAllDevices)
+ dev = inputInfo.all_devices;
+ else if (stuff->deviceid == XIAllMasterDevices)
+ dev = inputInfo.all_master_devices;
+ else
+ {
+ rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess);
+ if (rc != Success)
+ return rc;
+ }
if (stuff->grab_type != XIGrabtypeButton &&
stuff->grab_type != XIGrabtypeKeycode &&