[PATCH v2 libinput 2/2] touchpad: when clearing the touchpad state, release fake touches too

Peter Hutterer peter.hutterer at who-t.net
Mon May 4 03:37:01 PDT 2015


Causes an error message in the device_disable_release_tap_n_drag test. When
the touchpad is suspended, all touches are ended in tp_clear_state. Since the
hovering support was added, this returns the touches to TOUCH_HOVERING, a
subsequent tp_handle_state() will turn them back into TOUCH_BEGIN based on
BTN_TOUCH and BTN_TOOL_FINGER still being down.

Clear the fake touch buttons as well after ending the touches, this way the
touch points are reset to TOUCH_NONE as intended.
Once we do that we don't need to manually change the tap finger count when
releasing taps, we can just let the count reset naturally.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/evdev-mt-touchpad.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index d5ce880..e017559 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -750,6 +750,12 @@ tp_destroy(struct evdev_dispatch *dispatch)
 }
 
 static void
+tp_release_fake_touches(struct tp_dispatch *tp)
+{
+	tp->fake_touches = 0;
+}
+
+static void
 tp_clear_state(struct tp_dispatch *tp)
 {
 	uint64_t now = libinput_now(tp->device->base.seat->libinput);
@@ -772,6 +778,7 @@ tp_clear_state(struct tp_dispatch *tp)
 	tp_for_each_touch(tp, t) {
 		tp_end_sequence(tp, t, now);
 	}
+	tp_release_fake_touches(tp);
 
 	tp_handle_state(tp, now);
 }
-- 
2.3.5



More information about the wayland-devel mailing list