osd-classic: fix miscalculation for osd width in percentage

Fixes a regression in 75eb370.
This commit is contained in:
tokyo4j 2025-11-01 22:43:45 +09:00 committed by Johan Malm
parent 24b9bd93fb
commit 2d7e87ea75

View file

@ -86,7 +86,8 @@ osd_classic_create(struct output *output, struct wl_array *views)
int w = switcher_theme->width; int w = switcher_theme->width;
if (switcher_theme->width_is_percent) { if (switcher_theme->width_is_percent) {
w = output->wlr_output->width * switcher_theme->width / 100; w = output->wlr_output->width / output->wlr_output->scale
* switcher_theme->width / 100;
} }
int h = wl_array_len(views) * switcher_theme->item_height int h = wl_array_len(views) * switcher_theme->item_height
+ 2 * rc.theme->osd_border_width + 2 * switcher_theme->padding; + 2 * rc.theme->osd_border_width + 2 * switcher_theme->padding;