touchpad: rename the thumb detection methods
authorPeter Hutterer <peter.hutterer@who-t.net>
Thu, 20 Jun 2019 00:56:17 +0000 (10:56 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Mon, 15 Jul 2019 03:08:47 +0000 (13:08 +1000)
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 <peter.hutterer@who-t.net>
src/evdev-mt-touchpad-thumb.c
src/evdev-mt-touchpad.c
src/evdev-mt-touchpad.h

index 89d715e..c45a067 100644 (file)
@@ -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,
index a9d9d6a..9b7d30c 100644 (file)
@@ -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);
index 2444740..8845c8c 100644 (file)
@@ -688,12 +688,17 @@ 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);
 
 void