diff options
author | Chase Douglas <chase.douglas@canonical.com> | 2011-03-31 11:29:01 -0400 |
---|---|---|
committer | Chase Douglas <chase.douglas@canonical.com> | 2011-04-08 09:55:19 -0400 |
commit | 89142b356b3119d7b7012df075fc7698ec38e769 (patch) | |
tree | 17dff79ce842463e9de1ab907c83c68db095be44 | |
parent | f1a8f8afc7424346dbe3360eaa5fd95d458de2e0 (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>
(cherry picked from commit f40103cee1d591387359f401a5a7c21f4105aeb4)
-rw-r--r-- | dix/eventconvert.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/dix/eventconvert.c b/dix/eventconvert.c index 78938800e..edcb9dd2f 100644 --- a/dix/eventconvert.c +++ b/dix/eventconvert.c @@ -384,8 +384,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) |