[PATCH 1/9] dix: send proximity events if one or more axes are Absolute.

Peter Hutterer peter.hutterer at who-t.net
Thu Oct 21 23:29:28 PDT 2010


We only skip relative events for proximity, not absolute ones. Now with
mixed mode, just unset those axes that are relative.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 dix/getevents.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/dix/getevents.c b/dix/getevents.c
index 0b6d6d3..1d41fb7 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -1232,7 +1232,7 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons,
 int
 GetProximityEvents(EventList *events, DeviceIntPtr pDev, int type, const ValuatorMask *mask_in)
 {
-    int num_events = 1;
+    int num_events = 1, i;
     DeviceEvent *event;
     ValuatorMask mask;
 
@@ -1248,9 +1248,13 @@ GetProximityEvents(EventList *events, DeviceIntPtr pDev, int type, const Valuato
 
     valuator_mask_copy(&mask, mask_in);
 
-    /* Do we need to send a DeviceValuator event? */
-    if ((pDev->valuator->mode & 1) == Relative)
-        valuator_mask_zero(&mask);
+    /* ignore relative axes for proximity. */
+    for (i = 0; i < valuator_mask_num_valuators(&mask); i++)
+    {
+        if (valuator_mask_isset(&mask, i) &&
+            pDev->valuator->axes[i].mode == Relative)
+            valuator_mask_unset(&mask, i);
+    }
 
     events = UpdateFromMaster(events, pDev, DEVCHANGE_POINTER_EVENT, &num_events);
 
-- 
1.7.2.3



More information about the xorg-devel mailing list