From: Peter Hutterer Date: Wed, 19 Jun 2019 02:04:23 +0000 (+1000) Subject: touchpad: add helper function to reset a thumb's state X-Git-Tag: 1.13.901~1^2~17 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=117ef6508710b98f89d7072a63f0daca6899495b;p=platform%2Fupstream%2Flibinput.git touchpad: add helper function to reset a thumb's state Extracted from Matt Mayfield's thumb detection patches. Signed-off-by: Peter Hutterer --- diff --git a/src/evdev-mt-touchpad-thumb.c b/src/evdev-mt-touchpad-thumb.c index 4d9b6f2..bfa5256 100644 --- a/src/evdev-mt-touchpad-thumb.c +++ b/src/evdev-mt-touchpad-thumb.c @@ -63,6 +63,12 @@ tp_thumb_set_state(struct tp_dispatch *tp, } void +tp_thumb_reset(struct tp_dispatch *tp, struct tp_touch *t) +{ + t->thumb.state = THUMB_STATE_MAYBE; +} + +void tp_thumb_detect(struct tp_dispatch *tp, struct tp_touch *t, uint64_t time) { /* once a thumb, always a thumb, once ruled out always ruled out */ diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c index 349f730..e971638 100644 --- a/src/evdev-mt-touchpad.c +++ b/src/evdev-mt-touchpad.c @@ -353,7 +353,7 @@ tp_begin_touch(struct tp_dispatch *tp, struct tp_touch *t, uint64_t time) t->was_down = true; tp->nfingers_down++; t->palm.time = time; - t->thumb.state = THUMB_STATE_MAYBE; + tp_thumb_reset(tp, t); t->thumb.first_touch_time = time; t->tap.is_thumb = false; t->tap.is_palm = false; diff --git a/src/evdev-mt-touchpad.h b/src/evdev-mt-touchpad.h index 12a6b03..61422a5 100644 --- a/src/evdev-mt-touchpad.h +++ b/src/evdev-mt-touchpad.h @@ -685,6 +685,9 @@ bool tp_thumb_ignored(const struct tp_dispatch *tp, const struct tp_touch *t); void +tp_thumb_reset(struct tp_dispatch *tp, struct tp_touch *t); + +void tp_thumb_detect(struct tp_dispatch *tp, struct tp_touch *t, uint64_t time); void