]> git.mdlowis.com Git - proto/labwc.git/commitdiff
osd: move get_osd_height() closer to where it is called from
authorJohan Malm <jgm323@gmail.com>
Wed, 5 Jul 2023 18:52:01 +0000 (19:52 +0100)
committerJohan Malm <johanmalm@users.noreply.github.com>
Wed, 5 Jul 2023 20:31:30 +0000 (21:31 +0100)
src/osd.c

index 7b9f89d64ff0d2c70874eebd7a9c273d2bd15110..8a076dade3004928bbc1ebcc5f5740dcf4cfbf63 100644 (file)
--- a/src/osd.c
+++ b/src/osd.c
@@ -54,34 +54,6 @@ get_formatted_app_id(struct view *view)
        return s;
 }
 
-static int
-get_osd_height(struct wl_list *node_list)
-{
-       int height = 0;
-       struct view *view;
-       struct wlr_scene_node *node;
-       wl_list_for_each(node, node_list, link) {
-               if (!node->data) {
-                       /* We found some non-view, most likely the region overlay */
-                       continue;
-               }
-               view = node_view_from_node(node);
-               enum property skip = window_rules_get_property(view, "skipWindowSwitcher");
-               if (!isfocusable(view) || skip == LAB_PROP_TRUE) {
-                       continue;
-               }
-
-               /* Include item border width */
-               height += rc.theme->osd_window_switcher_item_height
-                       + rc.theme->osd_border_width * 2;
-       }
-
-       /* Add OSD border width */
-       height += 2 * rc.theme->osd_border_width;
-       height += 2 * rc.theme->osd_window_switcher_padding;
-       return height;
-}
-
 static void
 destroy_osd_nodes(struct output *output)
 {
@@ -430,6 +402,33 @@ render_osd(struct server *server, cairo_t *cairo, int w, int h,
        cairo_surface_flush(surf);
 }
 
+static int
+get_osd_height(struct wl_list *node_list)
+{
+       int height = 0;
+       struct view *view;
+       struct wlr_scene_node *node;
+       wl_list_for_each(node, node_list, link) {
+               if (!node->data) {
+                       /* We found some non-view, most likely the region overlay */
+                       continue;
+               }
+               view = node_view_from_node(node);
+               enum property skip = window_rules_get_property(view, "skipWindowSwitcher");
+               if (!isfocusable(view) || skip == LAB_PROP_TRUE) {
+                       continue;
+               }
+
+               /* Include item border width */
+               height += rc.theme->osd_window_switcher_item_height;
+       }
+
+       /* Add OSD border width */
+       height += 2 * rc.theme->osd_border_width;
+       height += 2 * rc.theme->osd_window_switcher_padding;
+       return height;
+}
+
 static void
 display_osd(struct output *output)
 {