From 456f23cbbd95eacc682284ffdede54f9a16d0c7d Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 28 May 2018 16:00:02 +1000 Subject: Ignore x/y axis changes on proximity out Wacom tablets send a farewell reset to 0 on all axes when the tool goes out of proximity. Ignore those so we can rely on our various 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 --- 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)) { -- cgit v1.2.1