summaryrefslogtreecommitdiff
path: root/Xi/xipassivegrab.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-06-01 15:37:53 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-06-02 16:02:31 +1000
commita66686a83edd6093ed540414dda2b8700e4696fe (patch)
tree99ffd0dcd21a716155cd779fd46453041136eefa /Xi/xipassivegrab.c
parentf00cf7675164bb984ef310412f9e09582813adb1 (diff)
input: add support for XIAllDevices and XIAllMasterDevices passive grabs.
These grabs are suported through two fake devices inputInfo.all_devices and inputInfo.all_master_devices. These devices are not part of the device list and are only initialised for their device id, nothing else. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'Xi/xipassivegrab.c')
-rw-r--r--Xi/xipassivegrab.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c
index fab333592..0c74544e4 100644
--- a/Xi/xipassivegrab.c
+++ b/Xi/xipassivegrab.c
@@ -90,9 +90,16 @@ ProcXIPassiveGrabDevice(ClientPtr client)
REQUEST(xXIPassiveGrabDeviceReq);
REQUEST_AT_LEAST_SIZE(xXIPassiveGrabDeviceReq);
- ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess);
- if (ret != Success)
- return ret;
+ if (stuff->deviceid == XIAllDevices)
+ dev = inputInfo.all_devices;
+ else if (stuff->deviceid == XIAllMasterDevices)
+ dev = inputInfo.all_master_devices;
+ else
+ {
+ ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess);
+ if (ret != Success)
+ return ret;
+ }
if (stuff->grab_type != XIGrabtypeButton &&
stuff->grab_type != XIGrabtypeKeysym &&