summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChase Douglas <chase.douglas@canonical.com>2011-03-31 11:29:01 -0400
committerPeter Hutterer <peter.hutterer@who-t.net>2011-04-04 09:55:01 +1000
commitf40103cee1d591387359f401a5a7c21f4105aeb4 (patch)
treecb2f61cfba26ad7fd497f402e7361cf8084fe2a6
parent8199eac443d2c22d313cb23e39d5e607a8cc7f99 (diff)
Don't report old relative values in getValuatorEvents
Relative valuator values should not be reported in any future events. If a relative valuator value is not set in an internal event, set the value to 0 for XI 1.x valuator events sent over the wire. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Simon Thum <simon.thum@gmx.de> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--dix/eventconvert.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/dix/eventconvert.c b/dix/eventconvert.c
index 5fdd35714..a5fe0a9cc 100644
--- a/dix/eventconvert.c
+++ b/dix/eventconvert.c
@@ -408,8 +408,10 @@ getValuatorEvents(DeviceEvent *ev, deviceValuator *xv)
for (j = 0; j < xv->num_valuators; j++) {
if (BitIsOn(ev->valuators.mask, xv->first_valuator + j))
valuators[j] = ev->valuators.data[xv->first_valuator + j];
- else
+ else if (dev->valuator->axes[xv->first_valuator + j].mode == Absolute)
valuators[j] = dev->valuator->axisVal[xv->first_valuator + j];
+ else
+ valuators[j] = 0;
}
if (i + 6 < num_valuators)