]> git.mdlowis.com Git - proto/labwc.git/commitdiff
osd-thumbnail: fix miscalculation for item geometries
authortokyo4j <hrak1529@gmail.com>
Sat, 1 Nov 2025 13:49:57 +0000 (22:49 +0900)
committerJohan Malm <johanmalm@users.noreply.github.com>
Sat, 1 Nov 2025 16:00:20 +0000 (16:00 +0000)
src/osd/osd-thumbnail.c

index 4e420cf11e8699378cd5345531ea8348b82e725d..0b98b4d2507076b6322a5fa881550b1eb7ea9eaf 100644 (file)
@@ -181,6 +181,7 @@ get_items_geometry(struct output *output, struct theme *theme,
        struct window_switcher_thumbnail_theme *switcher_theme =
                &theme->osd_window_switcher_thumbnail;
        int output_width = output->wlr_output->width / output->wlr_output->scale;
+       int padding = theme->osd_border_width + switcher_theme->padding;
 
        int max_bg_width = switcher_theme->max_width;
        if (switcher_theme->max_width_is_percent) {
@@ -191,8 +192,7 @@ get_items_geometry(struct output *output, struct theme *theme,
        *nr_cols = nr_thumbs;
        while (1) {
                assert(*nr_rows <= nr_thumbs);
-               int bg_width = *nr_cols * switcher_theme->item_width
-                       + theme->osd_border_width + switcher_theme->padding;
+               int bg_width = *nr_cols * switcher_theme->item_width + 2 * padding;
                if (bg_width < max_bg_width) {
                        break;
                }