[PATCH 3/9] dix: populate motion history only if the mode matches the first axis.

Peter Hutterer peter.hutterer at who-t.net
Thu Oct 21 23:29:30 PDT 2010


XI1 doesn't cater for mixed mode devices, so bail out on the first valuator
that has a different mode.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 dix/getevents.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/dix/getevents.c b/dix/getevents.c
index 1d41fb7..bbad692 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -378,8 +378,7 @@ AllocateMotionHistory(DeviceIntPtr pDev)
         int numAxes;
         /* XI1 doesn't understand mixed mode devices */
         for (numAxes = 0; numAxes < v->numAxes; numAxes++)
-            if ((v->axes[numAxes].mode & DeviceMode) !=
-                (v->mode & DeviceMode))
+            if (valuator_get_mode(pDev, numAxes) != valuator_get_mode(pDev, 0))
                 break;
         size = sizeof(INT32) * numAxes;
     }
@@ -564,8 +563,7 @@ updateMotionHistory(DeviceIntPtr pDev, CARD32 ms, ValuatorMask *mask,
         for (i = 0; i < v->numAxes; i++)
         {
             /* XI1 doesn't support mixed mode devices */
-            if ((pDev->valuator->axes[i].mode & DeviceMode) !=
-                (pDev->valuator->mode & DeviceMode))
+            if (valuator_get_mode(pDev, i) != valuator_get_mode(pDev, 0))
                 break;
             if (valuator_mask_size(mask) <= i || !valuator_mask_isset(mask, i))
             {
-- 
1.7.2.3



More information about the xorg-devel mailing list