[PATCH evdev 1/2] Ignore x/y axis changes on proximity out

Peter Hutterer peter.hutterer at who-t.net
Mon May 28 06:01:58 UTC 2018


Wacom tablet send a farewell reset to 0 on all axes when the tool goes out of
proximity. Ignore those so we can rely on our variuos valuator masks always
having the correct coordinates.

Possible false positive if you manage to go out of proximity right above the
zero datum but meh.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/evdev.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/evdev.c b/src/evdev.c
index 3d7b6f0..d07ee0a 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -551,6 +551,16 @@ EvdevProcessProximityState(InputInfoPtr pInfo)
         }
     }
 
+    /* Wacom's last frame resets all values to 0, including x/y.
+       Skip over this. */
+    if (prox_state == 0) {
+        int v;
+        if (valuator_mask_fetch(pEvdev->abs_vals, 0, &v) && v == 0)
+            valuator_mask_unset(pEvdev->abs_vals, 0);
+        if (valuator_mask_fetch(pEvdev->abs_vals, 1, &v) && v == 0)
+            valuator_mask_unset(pEvdev->abs_vals, 1);
+    }
+
     if ((prox_state && !pEvdev->in_proximity) ||
         (!prox_state && pEvdev->in_proximity))
     {
-- 
2.14.3



More information about the xorg-devel mailing list