diff options
author | Kirill Primak <vyivel@eclair.cafe> | 2022-11-02 23:43:37 +0300 |
---|---|---|
committer | Kirill Primak <vyivel@eclair.cafe> | 2022-11-06 17:00:00 +0300 |
commit | c09d3450d494e21f065c12f199fa5ba8bfd946a9 (patch) | |
tree | f38e995c41fce19b1a8bcd7b065357acfcb36b2a | |
parent | 099b9de752f9cc212140533a8a2e20b31aa9028f (diff) | |
download | wlroots-c09d3450d494e21f065c12f199fa5ba8bfd946a9.tar.xz |
compositor: enforce surface destruction order
-rw-r--r-- | types/wlr_compositor.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/types/wlr_compositor.c b/types/wlr_compositor.c index df55938c..da00e76d 100644 --- a/types/wlr_compositor.c +++ b/types/wlr_compositor.c @@ -36,6 +36,14 @@ static int max(int fst, int snd) { static void surface_handle_destroy(struct wl_client *client, struct wl_resource *resource) { + struct wlr_surface *surface = wlr_surface_from_resource(resource); + if (surface->role_data != NULL) { + // TODO: send WL_SURFACE_ERROR_DEFUNCT_ROLE_OBJECT + // https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/278 + wl_resource_post_error(resource, -1, + "surface was destroyed before its role object"); + return; + } wl_resource_destroy(resource); } |