[PATCH libinput 1/6] touchpad: always call into the the tap state machine
Peter Hutterer
peter.hutterer at who-t.net
Tue Jun 10 17:11:30 PDT 2014
A button event consumed by the softbutton or clickpad code does not feed into
the tap state machine, leaving it in its current state. The touch generating
that event however may have triggered state changes.
For some tap/click combinations this gives us either double press/release
events or an inconsistent order of events. Those issues include:
* a really short physical click causes a click + tap-click
* a really short physical click on the right software button causes a right
click + left tap-click
* tap + click causes double button left press events
To avoid these, notify the tap code that a button event has occured and
process that accordingly. Depending on the state this may either continue to
the DEAD state or release the current tap button and then go to the DEAD
state.
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
src/evdev-mt-touchpad.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index 8b502b7..0294eb2 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -545,13 +545,12 @@ tp_post_events(struct tp_dispatch *tp, uint64_t time)
{
struct tp_touch *t = tp_current_touch(tp);
double dx, dy;
+ int consumed = 0;
- if (tp_post_button_events(tp, time) != 0) {
- tp_stop_scroll_events(tp, time);
- return;
- }
+ consumed |= tp_tap_handle_state(tp, time);
+ consumed |= tp_post_button_events(tp, time);
- if (tp_tap_handle_state(tp, time) != 0) {
+ if (consumed) {
tp_stop_scroll_events(tp, time);
return;
}
--
1.9.3
More information about the wayland-devel
mailing list