mirror of
https://github.com/labwc/labwc.git
synced 2026-02-10 04:27:47 -05:00
icon-loader: load SVG icons at max scale of any usable output
- Add a new function to get the maximum scale of all usable outputs - Pass the maximum output scale through to img_svg_load(), which ultimately calls cairo_surface_set_device_scale() before rendering
This commit is contained in:
parent
a5d89a2e4c
commit
ddfaae98ad
8 changed files with 52 additions and 12 deletions
14
src/output.c
14
src/output.c
|
|
@ -1067,3 +1067,17 @@ output_enable_adaptive_sync(struct wlr_output *output, bool enabled)
|
|||
enabled ? "en" : "dis", output->name);
|
||||
}
|
||||
}
|
||||
|
||||
float
|
||||
output_max_scale(struct server *server)
|
||||
{
|
||||
/* Never return less than 1, in case outputs are disabled */
|
||||
float scale = 1;
|
||||
struct output *output;
|
||||
wl_list_for_each(output, &server->outputs, link) {
|
||||
if (output_is_usable(output)) {
|
||||
scale = MAX(scale, output->wlr_output->scale);
|
||||
}
|
||||
}
|
||||
return scale;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue