
It's possible to destory the xdg_toplevel and xdg_surface which removes the surface role and then re-use the surface on a new toplevel. Mutter used to not create new SurfaceActors for the new toplevel which were then shared between the old and new toplevel. This happens because the actors can stay around after the wl resource is destroyed (e.g. for closing effects). Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3667>