Skip to content

wayland/touch: Remove undelivered touches earlier

When the touch_down event was not delivered to Wayland clients, there's no point in keeping the touchpoint in our list, so remove it early inside update() instead of removing it after the touch ended.

This fixes a crash inside touch_handle_surface_destroy() where the assertion to make sure the surface is removed fails because the touch_count of the surface never reached 0. This in turn happened because a new sequence was added, while a (already ended one) wasn't removed from the touch->touches list before. This caused the touch counter to get incremented by 1 while no new sequence was added to the list (because Clutter reuses sequence IDs, the old sequence is equal to the new one, i.e. the new sequence already is present in the list).

Fixes #200 (closed)

@carlosg This is the fix you were in favour of. We could still remove the meta_wayland_touch_update function and probably even the whole meta_wayland_compositor_update procedure, that would be my preferred solution.

Edited by Jonas Dreßler

Merge request reports