touchpad: remove assert that may trigger during a race condition

There appears to be a race condition where an ABS_MT_TRACKING_ID -1
event is on the wire but libevdev_fetch_slot_value() for that slot
already gives us -1 as well.

If we just (re)opened our device, synching our slots would thus set zero
active slots and then trigger the assert when that event is being
processed.

It's unclear how to reliably reproduce this issue but removing the
assert and simply ignoring this event if we don't have active slots
is correct anyway.

Closes #1050

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1081>
This commit is contained in:
Peter Hutterer 2024-11-24 20:36:18 +10:00 committed by Marge Bot
parent 5915ac45dd
commit d773056d2e

View file

@ -546,8 +546,7 @@ tp_process_absolute(struct tp_dispatch *tp,
if (e->value != -1) {
tp->nactive_slots += 1;
tp_new_touch(tp, t, time);
} else {
assert(tp->nactive_slots >= 1);
} else if (tp->nactive_slots >= 1) {
tp->nactive_slots -= 1;
tp_end_sequence(tp, t, time);
}