[PATCH 2/3] xfree86: don't set movement flags for non-valuator events.
Peter Hutterer
peter.hutterer at who-t.net
Tue Dec 7 20:58:48 PST 2010
If a device doesn't send valuators, don't try to move its position.
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
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 c2cf438..4ee8336 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)) {
--
1.7.3.3
More information about the xorg-devel
mailing list