summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2011-03-02 14:52:42 +0000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-07-01 08:46:28 +1000
commite084ac30b37c36016bb0dbb1b79e60a7799aee02 (patch)
treeeab1022bf3c33c42c77dbdbc3a31b27da3407481
parent23a783278963919778d017965542e0f983814e37 (diff)
Input: Reset SD remainder when copying co-ords from MD
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@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--dix/getevents.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/dix/getevents.c b/dix/getevents.c
index fbc15e0c0..a12462a4a 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -320,6 +320,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;
@@ -339,14 +341,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);
+ }
}
}