touchpad: add a helper function for supressing a thumb

Only sets the state to YES at the moment, will do more in the future.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2019-06-21 11:26:11 +10:00
parent 15c8613a65
commit 282979558e
3 changed files with 11 additions and 2 deletions

View file

@ -535,7 +535,7 @@ tp_gesture_handle_state_unknown(struct tp_dispatch *tp, uint64_t time)
* more thumb motion on >2 finger gestures during detection.
*/
if (tp->thumb.detect_thumbs && thumb_mm < inner) {
tp_thumb_set_state(tp, thumb, THUMB_STATE_YES);
tp_thumb_suppress(tp, thumb);
return GESTURE_STATE_NONE;
}

View file

@ -101,6 +101,12 @@ tp_thumb_detect_pressure_size(const struct tp_dispatch *tp,
return is_thumb;
}
void
tp_thumb_suppress(struct tp_dispatch *tp, struct tp_touch *t)
{
tp_thumb_set_state(tp, t, THUMB_STATE_YES);
}
void
tp_thumb_update_touch(struct tp_dispatch *tp,
struct tp_touch *t,
@ -222,7 +228,7 @@ tp_thumb_update_multifinger(struct tp_dispatch *tp)
evdev_log_debug(tp->device,
"touch %d is speed-based thumb\n",
second->index);
tp_thumb_set_state(tp, second, THUMB_STATE_YES);
tp_thumb_suppress(tp, second);
}
void

View file

@ -687,6 +687,9 @@ 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_suppress(struct tp_dispatch *tp, struct tp_touch *t);
void
tp_thumb_update_touch(struct tp_dispatch *tp,
struct tp_touch *t,