diff --git a/doc/touchpad-tap-state-machine.svg b/doc/touchpad-tap-state-machine.svg
index 8429efa4..d02ffa36 100644
--- a/doc/touchpad-tap-state-machine.svg
+++ b/doc/touchpad-tap-state-machine.svg
@@ -1,3 +1,3 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/evdev-mt-touchpad-buttons.c b/src/evdev-mt-touchpad-buttons.c
index 23817da8..2ac889ec 100644
--- a/src/evdev-mt-touchpad-buttons.c
+++ b/src/evdev-mt-touchpad-buttons.c
@@ -1170,11 +1170,13 @@ tp_clickfinger_set_button(struct tp_dispatch *tp)
struct tp_touch *t;
struct tp_touch *first = NULL,
*second = NULL;
+ bool only_taps = tp->tap.hold_tap_enabled;
int32_t button_map[2][3] = {
{ BTN_LEFT, BTN_RIGHT, BTN_MIDDLE },
{ BTN_LEFT, BTN_MIDDLE, BTN_RIGHT },
};
+again:
tp_for_each_touch(tp, t) {
if (t->state != TOUCH_BEGIN && t->state != TOUCH_UPDATE)
continue;
@@ -1185,6 +1187,9 @@ tp_clickfinger_set_button(struct tp_dispatch *tp)
if (t->palm.state != PALM_NONE)
continue;
+ if (only_taps && t->tap.state != TAP_TOUCH_STATE_TOUCH)
+ continue;
+
nfingers++;
if (!first)
@@ -1193,6 +1198,11 @@ tp_clickfinger_set_button(struct tp_dispatch *tp)
second = t;
}
+ if (only_taps && nfingers == 0) {
+ only_taps = false;
+ goto again;
+ }
+
/* Only check for finger distance when there are 2 fingers on the
* touchpad */
if (nfingers != 2)
diff --git a/src/evdev-mt-touchpad-tap.c b/src/evdev-mt-touchpad-tap.c
index 2977062d..69eecb14 100644
--- a/src/evdev-mt-touchpad-tap.c
+++ b/src/evdev-mt-touchpad-tap.c
@@ -2027,7 +2027,6 @@ tp_tap_handle_event(struct tp_dispatch *tp,
tp_tap_clear_timer(tp);
if ((tp->tap.state == TAP_STATE_IDLE ||
- tp->tap.state == TAP_STATE_BUTTON ||
tp->tap.state == TAP_STATE_DEAD))
tp_tap_kill_all_touches(tp, NULL);
}