diff options
author | Daniel Stone <daniel@fooishbar.org> | 2007-08-01 01:08:26 +0300 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2007-08-01 01:53:31 +0300 |
commit | 4d238c5c67461ed747aa6c021d1532734f4c63fe (patch) | |
tree | 748f1bb829292d5234f31002028be8e8617d11b2 /dix/getevents.c | |
parent | 7c9e8fd56e1830f7a971187d14877ebbdf35c4b0 (diff) |
Input: GetPointerEvents: Deny events from devices without valuators
For some reason, my keyboard has 25 mouse buttons, but zero valuators. This
causes GPE to blow up spectacularly, trying to get (and set) co-ordinates from
devices without valuators. For now, just prevent this from ever happening,
and whack a dirty great FIXME in.
Diffstat (limited to 'dix/getevents.c')
-rw-r--r-- | dix/getevents.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/dix/getevents.c b/dix/getevents.c index 8a4f8ed41..67990f226 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -499,14 +499,18 @@ GetPointerEvents(xEvent *events, DeviceIntPtr pDev, int type, int buttons, if ((type == ButtonPress || type == ButtonRelease) && !pDev->button) return 0; + /* FIXME: I guess it should, in theory, be possible to post button events + * from devices without valuators. */ + if (!pDev->valuator) + return 0; + if (!coreOnly && pDev->coreEvents) num_events = 2; else num_events = 1; - if (type == MotionNotify && num_valuators <= 0) { + if (type == MotionNotify && num_valuators <= 0) return 0; - } /* Do we need to send a DeviceValuator event? */ if (!coreOnly && sendValuators) { |