mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
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:
parent
ef01ebe187
commit
0f62648d39
2 changed files with 8 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -180,7 +180,9 @@ 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 output_width, output_height;
|
||||
wlr_output_effective_resolution(output->wlr_output,
|
||||
&output_width, &output_height);
|
||||
int padding = theme->osd_border_width + switcher_theme->padding;
|
||||
|
||||
int max_bg_width = switcher_theme->max_width;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue