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 <Hi-Angel@yandex.ru>
(cherry picked from commit 734496d972)
This commit is contained in:
Konstantin Kharlamov 2018-06-13 14:38:20 +03:00 committed by Peter Hutterer
parent 9c43f860ed
commit 8347c9b5b9

View file

@ -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;
}
}