diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2010-12-08 14:43:51 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2010-12-09 10:03:26 +1000 |
commit | 9cf055892dd413932e54b43cc2dfea70bafd525f (patch) | |
tree | 31d2f1709464077ff156710bd423394f72c1f275 /hw/xfree86/common/xf86Xinput.c | |
parent | aba8133c9c5a50753c388d76407868ac69f4134b (diff) |
xfree86: don't set movement flags for non-valuator events.
If a device doesn't send valuators, don't try to move its position.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Diffstat (limited to 'hw/xfree86/common/xf86Xinput.c')
-rw-r--r-- | hw/xfree86/common/xf86Xinput.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index c2cf4382c..4ee83360c 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -1015,10 +1015,13 @@ xf86PostMotionEventM(DeviceIntPtr device, int dx = 0, dy = 0; #endif - if (is_absolute) - flags = POINTER_ABSOLUTE; - else - flags = POINTER_RELATIVE | POINTER_ACCELERATE; + if (valuator_mask_num_valuators(mask) > 0) + { + if (is_absolute) + flags = POINTER_ABSOLUTE; + else + flags = POINTER_RELATIVE | POINTER_ACCELERATE; + } #if XFreeXDGA /* The evdev driver may not always send all axes across. */ @@ -1160,10 +1163,13 @@ xf86PostButtonEventM(DeviceIntPtr device, int index; #endif - if (is_absolute) - flags = POINTER_ABSOLUTE; - else - flags = POINTER_RELATIVE | POINTER_ACCELERATE; + if (valuator_mask_num_valuators(mask) > 0) + { + if (is_absolute) + flags = POINTER_ABSOLUTE; + else + flags = POINTER_RELATIVE | POINTER_ACCELERATE; + } #if XFreeXDGA if (miPointerGetScreen(device)) { |