summaryrefslogtreecommitdiff
path: root/Xi
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-07-13 15:09:38 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-07-15 10:36:30 +1000
commitd040af7fa3c7314917414a28d723bdda3c4289c3 (patch)
tree8dd6d00a1c3e97477d3d87083193feb8948f0898 /Xi
parent81b64f668541217c1c9518ac4a7e3fdf0a6e4002 (diff)
Update to type-specific raw events - require inputproto 1.9.99.14.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'Xi')
-rw-r--r--Xi/exevents.c6
-rw-r--r--Xi/xiselectev.c12
2 files changed, 17 insertions, 1 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c
index 85baa03a9..984bc0718 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -986,7 +986,11 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device)
CHECKEVENT(ev);
- if (ev->any.type == ET_Raw)
+ if (ev->any.type == ET_RawKeyPress ||
+ ev->any.type == ET_RawKeyRelease ||
+ ev->any.type == ET_RawButtonPress ||
+ ev->any.type == ET_RawButtonRelease ||
+ ev->any.type == ET_RawMotion)
{
ProcessRawEvent((RawDeviceEvent*)ev, device);
return;
diff --git a/Xi/xiselectev.c b/Xi/xiselectev.c
index 2baae77f6..d7b16446f 100644
--- a/Xi/xiselectev.c
+++ b/Xi/xiselectev.c
@@ -102,6 +102,18 @@ ProcXISelectEvents(ClientPtr client)
return BadValue;
}
+ /* Raw events may only be selected on root windows */
+ if (win->parent && evmask->mask_len >= 1)
+ {
+ unsigned char *bits = (unsigned char*)&evmask[1];
+ if (BitIsOn(bits, XI_RawKeyPress) ||
+ BitIsOn(bits, XI_RawKeyRelease) ||
+ BitIsOn(bits, XI_RawButtonPress) ||
+ BitIsOn(bits, XI_RawButtonRelease) ||
+ BitIsOn(bits, XI_RawMotion))
+ return BadValue;
+ }
+
if ((evmask->mask_len * 4) >= (XI2LASTEVENT + 8)/8)
{
unsigned char *bits = (unsigned char*)&evmask[1];