diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2010-11-23 11:15:52 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2010-11-24 08:47:00 +1000 |
commit | 048e93593e3f7a99a7d2a219e1ce2bdc9d407807 (patch) | |
tree | e86c7c8cfc8d270ecf4f58affdcfaca064c99dc0 /dix | |
parent | 4f3e670fd28fceec384ff0d4ca7c1ff8d7a872ad (diff) |
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>
Diffstat (limited to 'dix')
-rw-r--r-- | dix/eventconvert.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/dix/eventconvert.c b/dix/eventconvert.c index b92169ee3..dd17898b7 100644 --- a/dix/eventconvert.c +++ b/dix/eventconvert.c @@ -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; |