From 447c67df62ea0187162c041736338f8c7f128309 Mon Sep 17 00:00:00 2001 From: John Lindgren Date: Wed, 13 Dec 2023 17:37:14 -0500 Subject: [PATCH] output: do not call wlr_scene_output_layout_add_output() twice Fixes an assertion failure that occurred if reconfiguring outputs after an output had been disabled using wlopm --off. Fixes: #1303 --- src/output.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/output.c b/src/output.c index 6d7048bf..eaec44bb 100644 --- a/src/output.c +++ b/src/output.c @@ -158,10 +158,14 @@ add_output_to_layout(struct server *server, struct output *output) wlr_log(WLR_ERROR, "unable to create scene output"); return; } + /* + * Note: wlr_scene_output_layout_add_output() is not + * safe to call twice, so we call it only when initially + * creating the scene_output. + */ + wlr_scene_output_layout_add_output(server->scene_layout, + layout_output, output->scene_output); } - - wlr_scene_output_layout_add_output(server->scene_layout, layout_output, - output->scene_output); } static void