From: Johan Malm Date: Wed, 5 Jul 2023 18:52:01 +0000 (+0100) Subject: osd: move get_osd_height() closer to where it is called from X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=b6dfffc782be183d1c22a920cd2a35b520e63d1f;p=proto%2Flabwc.git osd: move get_osd_height() closer to where it is called from --- diff --git a/src/osd.c b/src/osd.c index 7b9f89d6..8a076dad 100644 --- 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) {