From 4393bec40a157af5c398f7412b0df4f3462af6bd Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Tue, 29 Apr 2025 10:24:48 +0300 Subject: [PATCH] core: Short-circuit assign_outputs() during shutdown If we're shutting down, moving surfaces to a different output will not be profitable. Just clear out the output mask entirely and return early. This specifically avoids the following issue seen with the Wayland backend when shutting down: - outputs destroyed - colour manager destroyed - seats destroyed - pointer destroyed - sprite view destroyed - find new output for the sprite view - update colour profile for the sprite view - neither the view nor the compositor has any outputs left - try to use the stock sRGB transfer - oops, no colour manager Signed-off-by: Daniel Stone --- libweston/compositor.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libweston/compositor.c b/libweston/compositor.c index 3cc2fb7e1..55c930e0a 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -1557,6 +1557,12 @@ weston_surface_assign_output(struct weston_surface *es) uint32_t max, area, mask; pixman_box32_t *e; + if (es->compositor->shutting_down) { + es->output = NULL; + es->output_mask = 0; + return; + } + new_output = NULL; max = 0; mask = 0;