From 8347c9b5b9b4ec6f969cceb15907a9a2ebfb3116 Mon Sep 17 00:00:00 2001 From: Konstantin Kharlamov Date: Wed, 13 Jun 2018 14:38:20 +0300 Subject: [PATCH] touchpad: ignore motion on finger-up Ignore motion when pressure/touch size fell below the threshold, thus ending the touch. Real world significance: subjectively scrolling/cursor positioning with a touchpad now a bit better on SAMSUNG NP305V5A laptop. https://gitlab.freedesktop.org/libinput/libinput/merge_requests/4 Signed-off-by: Konstantin Kharlamov (cherry picked from commit 734496d972152dc9998f884c840550dc34c7088a) --- src/evdev-mt-touchpad.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c index a78a6151..a7514a5f 100644 --- a/src/evdev-mt-touchpad.c +++ b/src/evdev-mt-touchpad.c @@ -1522,6 +1522,11 @@ tp_pre_process_state(struct tp_dispatch *tp, uint64_t time) tp_for_each_touch(tp, t) { if (t->state == TOUCH_MAYBE_END) tp_end_touch(tp, t, time); + + /* Ignore motion when pressure/touch size fell below the + * threshold, thus ending the touch */ + if (t->state == TOUCH_END && t->history.count > 0) + t->point = tp_motion_history_offset(t, 0)->point; } }