From c73fc78407aa4eddd1dcd2f896d036ee68cb2c69 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 20 Dec 2024 15:52:09 +1000 Subject: [PATCH] touchpad: cancel any ongoing gesture if we're about to send a button This shouldn't have any effect in the current setup as there is "coincidentally" no overlap between the two state machines so this is effectively a noop. Nonetheless, if we're about to send a tap button event we cannot be in any other gesture than tapping so all swipe/pinch/holds need to be cancelled. Part-of: --- src/evdev-mt-touchpad-tap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/evdev-mt-touchpad-tap.c b/src/evdev-mt-touchpad-tap.c index 3c76c3d6..ff2d79d7 100644 --- a/src/evdev-mt-touchpad-tap.c +++ b/src/evdev-mt-touchpad-tap.c @@ -136,6 +136,8 @@ tp_tap_notify(struct tp_dispatch *tp, if (nfingers < 1 || nfingers > 3) return; + tp_gesture_cancel(tp, time); + button = button_map[tp->tap.map][nfingers - 1]; if (state == LIBINPUT_BUTTON_STATE_PRESSED)