osd: use wlr_output_effective_resolution() to get output geometry

Before this commit, output transformations were not taken into account for
parcent-based osd widths like:

osd.window-switcher.style-classic.width: 80%
osd.window-switcher.style-thumbnail.width.max: 80%
This commit is contained in:
tokyo4j 2025-11-02 01:12:42 +09:00 committed by Johan Malm
parent ef01ebe187
commit 0f62648d39
2 changed files with 8 additions and 3 deletions

View file

@ -84,10 +84,13 @@ osd_classic_create(struct output *output, struct wl_array *views)
bool show_workspace = wl_list_length(&rc.workspace_config.workspaces) > 1;
const char *workspace_name = server->workspaces.current->name;
int output_width, output_height;
wlr_output_effective_resolution(output->wlr_output,
&output_width, &output_height);
int w = switcher_theme->width;
if (switcher_theme->width_is_percent) {
w = output->wlr_output->width / output->wlr_output->scale
* switcher_theme->width / 100;
w = output_width * switcher_theme->width / 100;
}
int h = wl_array_len(views) * switcher_theme->item_height
+ 2 * rc.theme->osd_border_width + 2 * switcher_theme->padding;