summaryrefslogtreecommitdiff
path: root/src/evdev-mt-touchpad-tap.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2015-04-15 15:21:08 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2015-04-16 15:47:34 +1000
commit39f11253471500cd380c8977b8cbe0683abe6b1d (patch)
treea7fa1cd27db07f561edb8b0adb2b4756781e3755 /src/evdev-mt-touchpad-tap.c
parent7552cd04f7a50fb674ec826933dbdb7f804d7447 (diff)
touchpad: don't allow taps in the top half of the palm exclusion zone.
Touches in the exclusion zone are ignored for palm detection and don't move the cursor. Tapping however triggers before we know whether something is a palm or not, so we get erroneous button clickst. If a tap happens in the top half of the touchpad, within the palm exclusion zones, ignore it for tap purposes. To avoid further complicating the state machine simply pretend there was a movement > threshold on that finger. This advances the tap state machine properly that no button events are sent for this finger. https://bugs.freedesktop.org/show_bug.cgi?id=89625 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'src/evdev-mt-touchpad-tap.c')
-rw-r--r--src/evdev-mt-touchpad-tap.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/evdev-mt-touchpad-tap.c b/src/evdev-mt-touchpad-tap.c
index 69c9669f..49fabb50 100644
--- a/src/evdev-mt-touchpad-tap.c
+++ b/src/evdev-mt-touchpad-tap.c
@@ -571,6 +571,14 @@ tp_tap_handle_state(struct tp_dispatch *tp, uint64_t time)
t->tap.state = TAP_TOUCH_STATE_TOUCH;
t->tap.initial = t->point;
tp_tap_handle_event(tp, t, TAP_EVENT_TOUCH, time);
+
+ /* If we think this is a palm, pretend there's a
+ * motion event which will prevent tap clicks
+ * without requiring extra states in the FSM.
+ */
+ if (tp_palm_tap_is_palm(tp, t))
+ tp_tap_handle_event(tp, t, TAP_EVENT_MOTION, time);
+
} else if (t->state == TOUCH_END) {
tp->tap.tap_finger_count--;
tp_tap_handle_event(tp, t, TAP_EVENT_RELEASE, time);