From 7fbfb14419143d75466a68408942d9d460860d04 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 20 Jun 2019 10:56:17 +1000 Subject: [PATCH] touchpad: rename the thumb detection methods No functional changes, just prep work for a later patch where the thumbs will dynamically update their state (instead of just using yes/no/maybe). Extracted from Matt Mayfield's thumb detection patches. Signed-off-by: Peter Hutterer --- src/evdev-mt-touchpad-thumb.c | 6 ++++-- src/evdev-mt-touchpad.c | 4 ++-- src/evdev-mt-touchpad.h | 7 ++++++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/evdev-mt-touchpad-thumb.c b/src/evdev-mt-touchpad-thumb.c index 89d715e4..c45a0670 100644 --- a/src/evdev-mt-touchpad-thumb.c +++ b/src/evdev-mt-touchpad-thumb.c @@ -102,7 +102,9 @@ tp_thumb_detect_pressure_size(const struct tp_dispatch *tp, } void -tp_thumb_detect(struct tp_dispatch *tp, struct tp_touch *t, uint64_t time) +tp_thumb_update_touch(struct tp_dispatch *tp, + struct tp_touch *t, + uint64_t time) { /* once a thumb, always a thumb, once ruled out always ruled out */ if (!tp->thumb.detect_thumbs || @@ -178,7 +180,7 @@ tp_thumb_detect(struct tp_dispatch *tp, struct tp_touch *t, uint64_t time) } void -tp_detect_thumb_while_moving(struct tp_dispatch *tp) +tp_thumb_update_multifinger(struct tp_dispatch *tp) { struct tp_touch *t; struct tp_touch *first = NULL, diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c index a9d9d6a1..9b7d30ca 100644 --- a/src/evdev-mt-touchpad.c +++ b/src/evdev-mt-touchpad.c @@ -1679,7 +1679,7 @@ tp_process_state(struct tp_dispatch *tp, uint64_t time) tp_motion_history_reset(t); } - tp_thumb_detect(tp, t, time); + tp_thumb_update_touch(tp, t, time); tp_palm_detect(tp, t, time); tp_detect_wobbling(tp, t, time); tp_motion_hysteresis(tp, t); @@ -1722,7 +1722,7 @@ tp_process_state(struct tp_dispatch *tp, uint64_t time) if (have_new_touch && tp->nfingers_down == 2 && speed_exceeded_count > 5) - tp_detect_thumb_while_moving(tp); + tp_thumb_update_multifinger(tp); if (restart_filter) filter_restart(tp->device->pointer.filter, tp, time); diff --git a/src/evdev-mt-touchpad.h b/src/evdev-mt-touchpad.h index 24447402..8845c8cd 100644 --- a/src/evdev-mt-touchpad.h +++ b/src/evdev-mt-touchpad.h @@ -688,11 +688,16 @@ 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); +tp_thumb_update_touch(struct tp_dispatch *tp, + struct tp_touch *t, + uint64_t time); void tp_detect_thumb_while_moving(struct tp_dispatch *tp); +void +tp_thumb_update_multifinger(struct tp_dispatch *tp); + void tp_init_thumb(struct tp_dispatch *tp);