[PATCH libinput] touchpad: fix tapping that happens after a moving thumb

Friedrich Schöller code at schoeller.se
Sat May 5 01:49:32 UTC 2018


When finger movement exceeded the motion threshold before the finger was
recognized as a thumb, it would never be regarded as a thumb by the tap system.
This prohibited tapping until the thumb was lifted.

This is fixed by moving the check for the thumb state up such that it
happens before the motion threshold check.
---
 src/evdev-mt-touchpad-tap.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/evdev-mt-touchpad-tap.c b/src/evdev-mt-touchpad-tap.c
index 5946dc8f..e3e051ca 100644
--- a/src/evdev-mt-touchpad-tap.c
+++ b/src/evdev-mt-touchpad-tap.c
@@ -1039,6 +1039,9 @@ tp_tap_handle_state(struct tp_dispatch *tp, uint64_t time)
 				tp_tap_handle_event(tp, t, TAP_EVENT_RELEASE, time);
 			}
 			t->tap.state = TAP_TOUCH_STATE_IDLE;
+		} else if (tp->tap.state != TAP_STATE_IDLE &&
+			   t->thumb.state == THUMB_STATE_YES) {
+			tp_tap_handle_event(tp, t, TAP_EVENT_THUMB, time);
 		} else if (tp->tap.state != TAP_STATE_IDLE &&
 			   tp_tap_exceeds_motion_threshold(tp, t)) {
 			struct tp_touch *tmp;
@@ -1051,10 +1054,6 @@ tp_tap_handle_state(struct tp_dispatch *tp, uint64_t time)
 			}
 
 			tp_tap_handle_event(tp, t, TAP_EVENT_MOTION, time);
-		} else if (tp->tap.state != TAP_STATE_IDLE &&
-			   t->thumb.state == THUMB_STATE_YES &&
-			   !t->tap.is_thumb) {
-			tp_tap_handle_event(tp, t, TAP_EVENT_THUMB, time);
 		}
 	}
 
-- 
2.14.3



More information about the wayland-devel mailing list