compositor: refactor role object destruction
-
wlr_surface_destroy_role_object()
is introduced for role object implementations to use. This removes the need to havewlr_surface.events.destroy
event handler and avoids manual resetting ofwlr_surface.role_data
.-
wlr_xwayland_surface
is a bit special here; itswlr_surface_role.destroy
doesn't destroy the object, but merely drops the association with thewlr_surface
by unmapping the X11 surface.
-
- If a
wl_surface
gets destroyed before its role object, an (undefined for now) error is sent.
Additionally, NULL
checks have been removed from role object handlers; instead, the caller (wlr_surface
) has to check for role_data != NULL
.