summaryrefslogtreecommitdiff
path: root/dix/eventconvert.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-02-21 15:32:57 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-02-22 08:08:55 +1000
commit4cdf1013771bc86fe2f6d9223bc4a46753bc918f (patch)
treef6ccd8093389b7767cfdbe77cd9c54cce090455e /dix/eventconvert.c
parentb4ef34d4664e0eaac7211f7a22a2025958aa1527 (diff)
dix: a valuator number of 0 is valid (#34510)
For all but motion and proximity events, having no valuators is ok. Regression from 1.9, keyboard events are not converted to protocol events. X.Org Bug 34510 <http://bugs.freedesktop.org/show_bug.cgi?id=34510> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Tested-by: Timo Aaltonen <timo.aaltonen@canonical.com>
Diffstat (limited to 'dix/eventconvert.c')
-rw-r--r--dix/eventconvert.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/dix/eventconvert.c b/dix/eventconvert.c
index 7b894f016..dd1ca460b 100644
--- a/dix/eventconvert.c
+++ b/dix/eventconvert.c
@@ -263,8 +263,20 @@ eventToKeyButtonPointer(DeviceEvent *ev, xEvent **xi, int *count)
num_events = (countValuators(ev, &first) + 5)/6; /* valuator ev */
if (num_events <= 0)
{
- *count = 0;
- return BadMatch;
+ switch (ev->type)
+ {
+ case ET_KeyPress:
+ case ET_KeyRelease:
+ case ET_ButtonPress:
+ case ET_ButtonRelease:
+ /* no axes is ok */
+ break;
+ case ET_Motion:
+ case ET_ProximityIn:
+ case ET_ProximityOut:
+ *count = 0;
+ return BadMatch;
+ }
}
num_events++; /* the actual event event */