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: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1042>
This commit is contained in:
Peter Hutterer 2024-12-20 15:52:09 +10:00 committed by Marge Bot
parent 114af53824
commit c73fc78407

View file

@ -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)