[PATCH 14/27] Input: Reset SD remainder when copying co-ords from MD

Daniel Stone daniel at fooishbar.org
Fri Jun 3 07:59:50 PDT 2011


In updateSlaveDeviceCoords, pDev->last.valuators was being copied from
the master, but pDev->last.remainder wasn't.  Make sure we copy both, to
avoid minor inconsistencies.

Signed-off-by: Daniel Stone <daniel at fooishbar.org>
---
 dix/getevents.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/dix/getevents.c b/dix/getevents.c
index 182f2d9..b796000 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -325,6 +325,8 @@ updateSlaveDeviceCoords(DeviceIntPtr master, DeviceIntPtr pDev)
      * position of the pointer */
     pDev->last.valuators[0] = master->last.valuators[0];
     pDev->last.valuators[1] = master->last.valuators[1];
+    pDev->last.remainder[0] = master->last.remainder[0];
+    pDev->last.remainder[1] = master->last.remainder[1];
 
     if (!pDev->valuator)
         return;
@@ -344,14 +346,19 @@ updateSlaveDeviceCoords(DeviceIntPtr master, DeviceIntPtr pDev)
     if ((lastSlave = master->last.slave) && lastSlave->valuator) {
         for (i = 2; i < pDev->valuator->numAxes; i++) {
             if (i >= lastSlave->valuator->numAxes)
+            {
                 pDev->last.valuators[i] = 0;
+                pDev->last.remainder[i] = 0;
+            }
             else
+            {
                 pDev->last.valuators[i] =
                     rescaleValuatorAxis(pDev->last.valuators[i],
                             pDev->last.remainder[i],
                             &pDev->last.remainder[i],
                             lastSlave->valuator->axes + i,
                             pDev->valuator->axes + i, 0);
+            }
         }
     }
 
-- 
1.7.5.3



More information about the xorg-devel mailing list