touchpad: never reduce the slot count to 0
authorPeter Hutterer <peter.hutterer@who-t.net>
Fri, 14 Feb 2020 06:20:32 +0000 (16:20 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Tue, 18 Feb 2020 06:26:56 +0000 (06:26 +0000)
commit1e1b9c0e6085ba9b4259597dfec78f5b7fb34d99
treedaca7d39f2c1cc668b8b451279f0acfa8f0483bd
parent0da2e744eaf0da98ecab3413c25e5aa288b2fca8
touchpad: never reduce the slot count to 0

Where a user releases all touches during a SYN_DROPPED and then puts more than
one finger back down before we sync, we end up with nonzero fake touches but
a zero slot count. This is caused by a wrong event sequences provided by
libevdev in that case.

This really needs to be fixed in libevdev, see
https://gitlab.freedesktop.org/libevdev/libevdev/merge_requests/19

In the meantime, put a check in to ignore that case and never reduce the slot
count to 0. It still leaves us open for some issues where 3fg gestures may
stop working if the right sequences are triggered during SYN_DROPPED but
updating libevdev will eventually make that go away too.

Fixes #422

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
src/evdev-mt-touchpad.c
test/test-touchpad.c