From ba603ea1925cf68bafe24958d882dbe01d9111a5 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 2 Aug 2018 16:58:58 +1000 Subject: touchpad: improve finger counting for synaptics serial touchpads A three-finger touch may cause slot N to end, in a frame after the BTN_TOOL_TRIPLETAP. This causes tp->nfinger_down to be decremented to 2 as the touch switches to MAYBE_END - which happens to be our num_slots. We exit early and never restore the touch correctly. Fix this by checking that the number of fake touches is equal to the slots, if it is higher then we need to check for recovery. Fixes https://gitlab.freedesktop.org/libinput/libinput/issues/99 Signed-off-by: Peter Hutterer --- src/evdev-mt-touchpad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c index 25d0f23b..79f69b7d 100644 --- a/src/evdev-mt-touchpad.c +++ b/src/evdev-mt-touchpad.c @@ -554,7 +554,7 @@ tp_restore_synaptics_touches(struct tp_dispatch *tp, return; if (tp->nfingers_down >= nfake_touches || - tp->nfingers_down == tp->num_slots) + (tp->nfingers_down == tp->num_slots && nfake_touches == tp->num_slots)) return; /* Synaptics devices may end touch 2 on BTN_TOOL_TRIPLETAP -- cgit v1.2.3