diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-07-13 15:09:38 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-07-15 10:36:30 +1000 |
commit | d040af7fa3c7314917414a28d723bdda3c4289c3 (patch) | |
tree | 8dd6d00a1c3e97477d3d87083193feb8948f0898 /Xi/xiselectev.c | |
parent | 81b64f668541217c1c9518ac4a7e3fdf0a6e4002 (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/xiselectev.c')
-rw-r--r-- | Xi/xiselectev.c | 12 |
1 files changed, 12 insertions, 0 deletions
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]; |