compositor: use compositor to get renderer

This allows us to remove the renderer destroy listener. The
listener was buggy: compositors can't destroy surface resources on
their own.

The wlr_compositor will always outlive the wlr_surface, so no need
for a destroy listener.
This commit is contained in:
Simon Ser 2024-03-14 12:35:13 +01:00 committed by Isaac Freund
parent 508d8c9a01
commit 3075e6a6f9
2 changed files with 6 additions and 22 deletions

View file

@ -121,7 +121,7 @@ struct wlr_surface_output {
struct wlr_surface {
struct wl_resource *resource;
struct wlr_renderer *renderer; // may be NULL
struct wlr_compositor *compositor;
/**
* The surface's buffer, if any. A surface has an attached buffer when it
* commits with a non-null buffer in its pending state. A surface will not
@ -212,7 +212,6 @@ struct wlr_surface {
// private state
struct wl_listener renderer_destroy;
struct wl_listener role_resource_destroy;
struct {