summaryrefslogtreecommitdiff
path: root/Xi/xiselectev.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-06-08 12:24:24 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-06-09 10:34:30 +1000
commit0e66a443a09176b8a875195d5473b953c07aa1d7 (patch)
treeb4a29bd8c5de692015dc051abbc2c9e1d6197fe9 /Xi/xiselectev.c
parent69a9545d1f8110841538410818df19fd960412c5 (diff)
Xi: return BadValue for XI_HierarchyChangd mask on devices.
This mask may only be selected for XIAllDevices. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'Xi/xiselectev.c')
-rw-r--r--Xi/xiselectev.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Xi/xiselectev.c b/Xi/xiselectev.c
index 9dbdea72c..51d9c9928 100644
--- a/Xi/xiselectev.c
+++ b/Xi/xiselectev.c
@@ -97,6 +97,13 @@ ProcXISelectEvent(ClientPtr client)
if (rc != Success)
return rc;
+ /* hierarchy event mask is not allowed on devices */
+ if (evmask->deviceid != XIAllDevices && evmask->mask_len >= 1)
+ {
+ unsigned char *bits = (unsigned char*)&evmask[1];
+ if (BitIsOn(bits, XI_HierarchyChanged))
+ return BadValue;
+ }
if ((evmask->mask_len * 4) > XI_LASTEVENT)
{