Merge branch 'tapping-with-former-edge-palms' into 'main'

Fix: touches could be simultaneously palms for taps and non-palms for gestures

See merge request libinput/libinput!1135
This commit is contained in:
satrmb 2025-06-29 08:58:06 +00:00
commit 9cad3a1213

View file

@ -1231,12 +1231,44 @@ tp_tap_handle_state(struct tp_dispatch *tp, uint64_t time)
* ignore any event from it.
*/
if (t->tap.is_palm) {
if (t->state == TOUCH_END)
if (t->state == TOUCH_END) {
tp_tap_handle_event(tp,
t,
TAP_EVENT_PALM_UP,
time);
continue;
continue;
}
if (t->palm.state != PALM_NONE)
continue;
/* Treat a touch previously classified as palm as a new
* touch when it ceases to be a palm. Several palm
* detection mechanisms such as PALM_EDGE or
* PALM_TOOL_PALM can release palms like this. */
tp_tap_handle_event(tp,
t,
TAP_EVENT_PALM_UP,
time);
t->tap.is_palm = false;
tp->tap.nfingers_down++;
tp_tap_handle_event(tp,
t,
TAP_EVENT_TOUCH,
time);
/* Since we're evidently not quite sure about the palm
* state of this touch, disqualify it from tapping to be
* safe. The initial coordinates and timestamp are also
* lost at this point, so motion and timeout checks
* couldn't be accurate anyway. */
struct tp_touch *tmp;
tp_for_each_touch(tp, tmp) {
if (tmp->tap.state == TAP_TOUCH_STATE_TOUCH)
tmp->tap.state = TAP_TOUCH_STATE_DEAD;
}
tp_tap_handle_event(tp,
t,
TAP_EVENT_MOTION,
time);
}
if (t->state == TOUCH_HOVERING)