]> git.mdlowis.com Git - proto/labwc.git/commitdiff
cycle: move & rename destroy_osd_scenes()
authortokyo4j <hrak1529@gmail.com>
Sun, 30 Nov 2025 13:03:56 +0000 (22:03 +0900)
committerJohan Malm <johanmalm@users.noreply.github.com>
Sun, 30 Nov 2025 21:33:46 +0000 (21:33 +0000)
src/cycle/cycle.c

index 306607dd72d793d7ea3b4aab1084ecb0113110a9..cb32915077c279e4e5e752fe23f7244774da6e8a 100644 (file)
 #include "view.h"
 
 static void update_cycle(struct server *server);
-
-static void
-destroy_osd_scenes(struct server *server)
-{
-       struct output *output;
-       wl_list_for_each(output, &server->outputs, link) {
-               struct cycle_osd_item *item, *tmp;
-               wl_list_for_each_safe(item, tmp, &output->cycle_osd.items, link) {
-                       wl_list_remove(&item->link);
-                       free(item);
-               }
-               if (output->cycle_osd.tree) {
-                       wlr_scene_node_destroy(&output->cycle_osd.tree->node);
-                       output->cycle_osd.tree = NULL;
-               }
-       }
-}
+static void destroy_cycle(struct server *server);
 
 static void
 update_preview_outlines(struct view *view)
@@ -130,7 +114,7 @@ cycle_on_view_destroy(struct view *view)
 
        if (cycle->selected_view) {
                /* Recreate the OSD to reflect the view has now gone. */
-               destroy_osd_scenes(server);
+               destroy_cycle(server);
                update_cycle(server);
        }
 }
@@ -214,7 +198,7 @@ cycle_finish(struct server *server, bool switch_focus)
        server->cycle.selected_view = NULL;
        server->cycle.preview_was_shaded = false;
 
-       destroy_osd_scenes(server);
+       destroy_cycle(server);
 
        if (server->cycle.preview_outline) {
                /* Destroy the whole multi_rect so we can easily react to new themes */
@@ -351,3 +335,20 @@ update_cycle(struct server *server)
 out:
        wl_array_release(&views);
 }
+
+static void
+destroy_cycle(struct server *server)
+{
+       struct output *output;
+       wl_list_for_each(output, &server->outputs, link) {
+               struct cycle_osd_item *item, *tmp;
+               wl_list_for_each_safe(item, tmp, &output->cycle_osd.items, link) {
+                       wl_list_remove(&item->link);
+                       free(item);
+               }
+               if (output->cycle_osd.tree) {
+                       wlr_scene_node_destroy(&output->cycle_osd.tree->node);
+                       output->cycle_osd.tree = NULL;
+               }
+       }
+}