Skip to content

compositor: refactor role object destruction

  • wlr_surface_destroy_role_object() is introduced for role object implementations to use. This removes the need to have wlr_surface.events.destroy event handler and avoids manual resetting of wlr_surface.role_data.
    • wlr_xwayland_surface is a bit special here; its wlr_surface_role.destroy doesn't destroy the object, but merely drops the association with the wlr_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.

Merge request reports