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>
This commit is contained in:
Peter Hutterer 2011-02-21 15:32:57 +10:00
parent b4ef34d466
commit 4cdf101377

View File

@ -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 */