From f52d5cd374563544dafe29587411f345e31bbdf8 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Wed, 31 Aug 2011 00:46:52 +0200 Subject: 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 Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer --- Xi/xipassivegrab.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'Xi') 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 && -- cgit v1.2.3