dix: when converting to XI 1.x events, use the first_valuator's device mode
Don't stop processing events when a valuator's mode doesn't match the 0th valuator's mode. Instead, start with the first_valuator in the event and keep stacking them on until the first valuator with a different mode is hit. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
This commit is contained in:
parent
4f3e670fd2
commit
048e93593e
|
@ -324,14 +324,16 @@ countValuators(DeviceEvent *ev, int *first)
|
|||
|
||||
for (i = 0; i < sizeof(ev->valuators.mask) * 8; i++)
|
||||
{
|
||||
/* Assume mode of 0th valuator matches XI1 device mode. Stop when the
|
||||
* event mode changes since XI1 can't handle mixed mode devices.
|
||||
*/
|
||||
if (BitIsOn(ev->valuators.mode, i) != BitIsOn(ev->valuators.mode, 0))
|
||||
break;
|
||||
|
||||
if (BitIsOn(ev->valuators.mask, i))
|
||||
{
|
||||
/* Assume mode of first_valuator matches XI1 device mode. Stop when the
|
||||
* event mode changes since XI1 can't handle mixed mode devices.
|
||||
*/
|
||||
if (first_valuator > -1 &&
|
||||
BitIsOn(ev->valuators.mode, i) !=
|
||||
BitIsOn(ev->valuators.mode, first_valuator))
|
||||
break;
|
||||
|
||||
if (first_valuator == -1)
|
||||
first_valuator = i;
|
||||
last_valuator = i;
|
||||
|
|
Loading…
Reference in New Issue
Block a user