touchpad: disable speed-based thumb detection if hold-and-tap is enabled

New touches arriving while other touches are moving fast could be taps,
not just thumbs.

Signed-off-by: satrmb <10471-satrmb@users.noreply.gitlab.freedesktop.org>
This commit is contained in:
satrmb 2020-08-09 15:28:45 +02:00
parent 3b0c194f80
commit 86057a7740

View file

@ -321,13 +321,14 @@ tp_thumb_update_multifinger(struct tp_dispatch *tp)
mm = evdev_device_unit_delta_to_mm(tp->device, &distance);
/* Speed-based thumb detection: if an existing finger is moving, and
* a new touch arrives, mark it as a thumb if it doesn't qualify as a
* 2-finger scroll. Also account for a thumb dropping onto the touchpad
* while scrolling or swiping.
* a new touch arrives, and hold-and-tap is disabled, mark it as a thumb
* if it doesn't qualify as a 2-finger scroll. Also account for a thumb
* dropping onto the touchpad while scrolling or swiping.
*/
if (newest &&
tp->thumb.state == THUMB_STATE_FINGER &&
tp->nfingers_down >= 2 &&
!tp->tap.hold_tap_enabled &&
speed_exceeded_count > 5 &&
(tp->scroll.method != LIBINPUT_CONFIG_SCROLL_2FG ||
(mm.x > SCROLL_MM_X || mm.y > SCROLL_MM_Y))) {