aboutsummaryrefslogtreecommitdiff
path: root/src/evdev.c
diff options
context:
space:
mode:
authorPaulo Zanoni <paulo.r.zanoni@intel.com>2011-12-15 12:26:37 -0200
committerPeter Hutterer <peter.hutterer@who-t.net>2011-12-16 16:09:16 +1000
commit7909975b0b965fbf0935bf012987a5368ea0e67a (patch)
treeb059e3359707acaeed0f6ba9911932068eb50089 /src/evdev.c
parentFix absolute events with swapped axes (diff)
downloadxf86-input-evdev-7909975b0b965fbf0935bf012987a5368ea0e67a.tar.gz
xf86-input-evdev-7909975b0b965fbf0935bf012987a5368ea0e67a.tar.bz2
xf86-input-evdev-7909975b0b965fbf0935bf012987a5368ea0e67a.zip
Fix relative events with swapped axes
After we swap the axes, we only call valuator_mask_set for axes that are not zero, so we need to unset the axes that became zero when swapped. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/evdev.c')
-rw-r--r--src/evdev.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/evdev.c b/src/evdev.c
index b1f9b2e..562c7e7 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -408,6 +408,10 @@ EvdevProcessValuators(InputInfoPtr pInfo)
tmp = pEvdev->delta[REL_X];
pEvdev->delta[REL_X] = pEvdev->delta[REL_Y];
pEvdev->delta[REL_Y] = tmp;
+ if (pEvdev->delta[REL_X] == 0)
+ valuator_mask_unset(pEvdev->vals, REL_X);
+ if (pEvdev->delta[REL_Y] == 0)
+ valuator_mask_unset(pEvdev->vals, REL_Y);
}
if (pEvdev->invert_x)
pEvdev->delta[REL_X] *= -1;