]> git.mdlowis.com Git - proto/labwc.git/commitdiff
src/output.c: Release layer tree when releasing output
authoryuanye <yuanye1@kylinos.cn>
Tue, 15 Nov 2022 01:38:15 +0000 (09:38 +0800)
committerJohan Malm <johanmalm@users.noreply.github.com>
Tue, 3 Jan 2023 19:46:31 +0000 (19:46 +0000)
Split off from PR #622 and slightly modified by @Consolatis

src/output.c

index efbdcdd8022eb49c5ddf4413042e94da521391e2..e80307185f3b292338828a2f2285b36bc0f38542 100644 (file)
@@ -44,6 +44,13 @@ output_destroy_notify(struct wl_listener *listener, void *data)
        wl_list_remove(&output->frame.link);
        wl_list_remove(&output->destroy.link);
 
+       int nr_layers = sizeof(output->layer_tree) / sizeof(output->layer_tree[0]);
+       for (int i = 0; i < nr_layers; i++) {
+               wlr_scene_node_destroy(&output->layer_tree[i]->node);
+       }
+       wlr_scene_node_destroy(&output->layer_popup_tree->node);
+       wlr_scene_node_destroy(&output->osd_tree->node);
+
        struct view *view;
        struct server *server = output->server;
        wl_list_for_each(view, &server->views, link) {
@@ -238,7 +245,7 @@ output_update_for_layout_change(struct server *server)
 
        /*
         * "Move" each wlr_output_cursor (in per-output coordinates) to
-        * align with the seat cursor.  Set a default cursor image so
+        * align with the seat cursor. Set a default cursor image so
         * that the cursor isn't invisible on new outputs.
         *
         * TODO: remember the most recent cursor image (see cursor.c)