mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
HiDPI: fix osd placement and maximized scale
This commit is contained in:
parent
6698ca7300
commit
ed3d0cd523
2 changed files with 15 additions and 3 deletions
12
src/output.c
12
src/output.c
|
|
@ -522,14 +522,20 @@ render_osd(struct output *output, pixman_region32_t *damage,
|
||||||
|
|
||||||
/* show on screen display (osd) on all outputs */
|
/* show on screen display (osd) on all outputs */
|
||||||
struct output *o;
|
struct output *o;
|
||||||
|
struct wlr_output_layout *layout = server->output_layout;
|
||||||
|
struct wlr_output_layout_output *ol_output;
|
||||||
wl_list_for_each(o, &server->outputs, link) {
|
wl_list_for_each(o, &server->outputs, link) {
|
||||||
struct wlr_box usable = output_usable_area_in_layout_coords(o);
|
ol_output = wlr_output_layout_get(layout, o->wlr_output);
|
||||||
struct wlr_box box = {
|
struct wlr_box box = {
|
||||||
.x = usable.x + (usable.width - server->osd->width) / 2,
|
.x = ol_output->x + o->wlr_output->width
|
||||||
.y = usable.y + (usable.height - server->osd->height) / 2,
|
/ o->wlr_output->scale / 2,
|
||||||
|
.y = ol_output->y + o->wlr_output->height
|
||||||
|
/ o->wlr_output->scale / 2,
|
||||||
.width = server->osd->width,
|
.width = server->osd->width,
|
||||||
.height = server->osd->height,
|
.height = server->osd->height,
|
||||||
};
|
};
|
||||||
|
box.x -= server->osd->width / 2;
|
||||||
|
box.y -= server->osd->height / 2;
|
||||||
render_texture_helper(output, damage, &box, server->osd);
|
render_texture_helper(output, damage, &box, server->osd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -139,6 +139,12 @@ view_maximize(struct view *view, bool maximize)
|
||||||
|
|
||||||
struct output *output = view_output(view);
|
struct output *output = view_output(view);
|
||||||
struct wlr_box box = output_usable_area_in_layout_coords(output);
|
struct wlr_box box = output_usable_area_in_layout_coords(output);
|
||||||
|
if (box.height == output->wlr_output->height && output->wlr_output->scale != 1) {
|
||||||
|
box.height /= output->wlr_output->scale;
|
||||||
|
}
|
||||||
|
if (box.width == output->wlr_output->width && output->wlr_output->scale != 1) {
|
||||||
|
box.width /= output->wlr_output->scale;
|
||||||
|
}
|
||||||
|
|
||||||
if (view->ssd.enabled) {
|
if (view->ssd.enabled) {
|
||||||
struct border border = ssd_thickness(view);
|
struct border border = ssd_thickness(view);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue