[PATCH 3/6] dix: when converting to XI 1.x events, use the first_valuator's device mode

Peter Hutterer peter.hutterer at who-t.net
Mon Nov 22 19:35:42 PST 2010


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 at who-t.net>
---
 dix/eventconvert.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/dix/eventconvert.c b/dix/eventconvert.c
index b92169e..dd17898 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;
-- 
1.7.3.2



More information about the xorg-devel mailing list