summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2018-09-06 14:11:23 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2018-09-06 14:11:23 +1000
commitf38fae3a8990f93153f9fa740f0d40c3c5cff947 (patch)
treebcc7f009d69837d74444c11c145deeb19b36696b /src
parentf8fec24c2f6e13440c4f7db7cbcc7a7dbe7d6299 (diff)
tablet: on tip down/up, force the delta to zero
We may get a pointer jump on tip down/up, see #128. For absolute coordinates we reset the history to avoid smoothing across that jump but deltas still used to be calculated based on the previous position to the current one. This can result in a large jump on tip down. Since the delta is supposed to be useful (and not physically accurate, see the docs), let's force it to 0/0 on tip down/up to avoid that scenario. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src')
-rw-r--r--src/evdev-tablet.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/evdev-tablet.c b/src/evdev-tablet.c
index 4776c6de..21b93663 100644
--- a/src/evdev-tablet.c
+++ b/src/evdev-tablet.c
@@ -436,8 +436,12 @@ tablet_tool_process_delta(struct tablet_dispatch *tablet,
struct device_coords delta = { 0, 0 };
struct device_float_coords accel;
+ /* When tool contact changes, we probably got a cursor jump. Don't
+ try to calculate a delta for that event */
if (!tablet_has_status(tablet,
TABLET_TOOL_ENTERING_PROXIMITY) &&
+ !tablet_has_status(tablet, TABLET_TOOL_ENTERING_CONTACT) &&
+ !tablet_has_status(tablet, TABLET_TOOL_LEAVING_CONTACT) &&
(bit_is_set(tablet->changed_axes, LIBINPUT_TABLET_TOOL_AXIS_X) ||
bit_is_set(tablet->changed_axes, LIBINPUT_TABLET_TOOL_AXIS_Y))) {
delta.x = axes->point.x - tablet->last_smooth_point.x;