]> git.mdlowis.com Git - proto/labwc.git/commitdiff
output: do not call wlr_scene_output_layout_add_output() twice
authorJohn Lindgren <john@jlindgren.net>
Wed, 13 Dec 2023 22:37:14 +0000 (17:37 -0500)
committerConsolatis <35009135+Consolatis@users.noreply.github.com>
Tue, 19 Dec 2023 00:03:08 +0000 (01:03 +0100)
Fixes an assertion failure that occurred if reconfiguring outputs after
an output had been disabled using wlopm --off.

Fixes: #1303
src/output.c

index 6d7048bf3cb66486d6985f4f149d308c16b41a38..eaec44bb537533de8fa3865f65d4b96a2dd4475e 100644 (file)
@@ -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