wayland: Destroying and recreating a wl_subsurface doesn't reset its parent-child relationship and position
Affected version
Fedora Linux 38, Mutter 44.5, Wayland
Bug summary
Destroying and recreating a wl_subsurface doesn't reset its parent-child relationship and position, which is against the protocol.
See:
- https://gitlab.freedesktop.org/wayland/wayland/-/issues/414
- https://gitlab.freedesktop.org/wayland/wayland/-/issues/414#note_2135486
Steps to reproduce
Build and execute https://gitlab.freedesktop.org/vyivel/randfall/-/blob/main/cases/subsurface_interactive_recreate_without_parent_commit.c.
What happened
The red subsurface is displayed before the parent surface's state has been committed at the position set before destroying and recreating the wl_subsurface
object.
What did you expect to happen
The red subsurface shouldn't be visible.