From 9cf055892dd413932e54b43cc2dfea70bafd525f Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 8 Dec 2010 14:43:51 +1000 Subject: [PATCH] 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 Reviewed-by: Chase Douglas --- hw/xfree86/common/xf86Xinput.c | 22 ++++++++++++++-------- 1 file 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)) {