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
This commit is contained in:
John Lindgren 2023-12-13 17:37:14 -05:00 committed by Consolatis
parent 17cbfb7299
commit 447c67df62

View file

@ -158,10 +158,14 @@ add_output_to_layout(struct server *server, struct output *output)
wlr_log(WLR_ERROR, "unable to create scene output"); wlr_log(WLR_ERROR, "unable to create scene output");
return; 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 static void