From a0d7517f4f80529394e5be4949b060d0bf5b67fe Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 1 Dec 2014 10:26:38 +0100 Subject: [PATCH libinput v3] touchpad: Allow the center of pinned fingers to drift over time Allow the center of pinned fingers to drift over time, to avoid accidentally unpinning fingers. BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=86807 Signed-off-by: Hans de Goede --- 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 8f76ddb..c2288e5 100644 --- a/src/evdev-mt-touchpad.c +++ b/src/evdev-mt-touchpad.c @@ -318,7 +318,12 @@ tp_unpin_finger(struct tp_dispatch *tp, struct tp_touch *t) tp->buttons.motion_dist * tp->buttons.motion_dist) { t->pinned.is_pinned = false; tp_set_pointer(tp, t); + return; } + + /* The finger may slowly drift, adjust the center */ + t->pinned.center_x = t->x + t->pinned.center_x / 2; + t->pinned.center_y = t->y + t->pinned.center_y / 2; } static void -- 2.1.0