mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-04-21 17:00:46 +02:00
touchpad: don't end below-threshold pressure touches if nfake_fingers > nslots
If we have more BTN_TOOL_*TAP fingers down than we have slots, ignore any
below-threshold pressure changes on the slots. When a touchpad only detects
two touches, guessing whether the third touch has sufficient pressure is
unreliable. Instead, always assume that all touches have sufficient pressure
when we exceed the slot number.
Exception: if all real fingers are below the pressure threshold, the fake
fingers are ignored too.
Related to https://bugs.freedesktop.org/show_bug.cgi?id=105258
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 3979b9e16a)
This commit is contained in:
parent
dd85749e61
commit
40750c26f8
2 changed files with 13 additions and 2 deletions
|
|
@ -1114,7 +1114,9 @@ tp_unhover_pressure(struct tp_dispatch *tp, uint64_t time)
|
|||
tp_motion_history_reset(t);
|
||||
tp_begin_touch(tp, t, time);
|
||||
}
|
||||
} else {
|
||||
/* don't unhover for pressure if we have too many
|
||||
* fake fingers down, see comment below */
|
||||
} else if (nfake_touches <= tp->num_slots) {
|
||||
if (t->pressure < tp->pressure.low) {
|
||||
evdev_log_debug(tp->device,
|
||||
"pressure: end touch\n");
|
||||
|
|
|
|||
|
|
@ -1631,10 +1631,19 @@ START_TEST(touchpad_3fg_tap_pressure_btntool)
|
|||
litest_event(dev, EV_KEY, BTN_TOOL_DOUBLETAP, 1);
|
||||
litest_event(dev, EV_KEY, BTN_TOOL_TRIPLETAP, 0);
|
||||
litest_pop_event_frame(dev);
|
||||
litest_assert_empty_queue(li);
|
||||
|
||||
litest_touch_up(dev, 0);
|
||||
litest_touch_up(dev, 1);
|
||||
libinput_dispatch(li);
|
||||
litest_timeout_tap();
|
||||
libinput_dispatch(li);
|
||||
|
||||
litest_assert_button_event(li,
|
||||
BTN_MIDDLE,
|
||||
LIBINPUT_BUTTON_STATE_PRESSED);
|
||||
litest_assert_button_event(li,
|
||||
BTN_MIDDLE,
|
||||
LIBINPUT_BUTTON_STATE_RELEASED);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue