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 <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer
2018-05-28 16:00:02 +10:00
parent ab1d9adfd3
commit 456f23cbbd

View File

@@ -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))
{