summaryrefslogtreecommitdiff
path: root/Xi/xiselectev.c
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2012-09-07 18:17:46 +0100
committerPeter Hutterer <peter.hutterer@who-t.net>2012-10-08 11:19:22 +1000
commitaacfc321b44eae15020875a2b2c9b6ff0e14dd8c (patch)
tree82eef2ddf9252ee8a23546a3caaa9d0267c36c24 /Xi/xiselectev.c
parente31e272f4fc8b2aa8e2101b89bb65bc1d6a5e1be (diff)
Touch: Fix duplicate TouchBegin selection with virtual devices
Given the following scenario: 1) client A selects for TouchBegin on window W for device D 2) client B selects for TouchBegin on window W for XIAllDevices 3) client C selects for TouchBegin on window W with device E Step 3 will fail with BadImplementation, because attempting to look up XIAllDevices or XIAllMasterDevices with dixLookupDevices doesn't work. This should succeed (or, if it was selecting for device D, fail with BadAccess as it would be a duplicate selection). Fix this by performing the appropriate lookup for virtual devices. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Chase Douglas <chase.douglas@ubuntu.com> (cherry picked from commit 3d2b768efae9936c6929c2bc13c7a1acc074ecd3)
Diffstat (limited to 'Xi/xiselectev.c')
-rw-r--r--Xi/xiselectev.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/Xi/xiselectev.c b/Xi/xiselectev.c
index 0e45cb8cb..ab1b6245f 100644
--- a/Xi/xiselectev.c
+++ b/Xi/xiselectev.c
@@ -180,8 +180,13 @@ ProcXISelectEvents(ClientPtr client)
if (CLIENT_ID(iclient->resource) == client->index)
continue;
- dixLookupDevice(&tmp, evmask->deviceid, serverClient,
- DixReadAccess);
+ if (evmask->deviceid == XIAllDevices)
+ tmp = inputInfo.all_devices;
+ else if (evmask->deviceid == XIAllMasterDevices)
+ tmp = inputInfo.all_master_devices;
+ else
+ dixLookupDevice(&tmp, evmask->deviceid, serverClient,
+ DixReadAccess);
if (!tmp)
return BadImplementation; /* this shouldn't happen */