HiDPI: fix osd placement and maximized scale

This commit is contained in:
ARDiDo 2021-11-24 11:11:48 -05:00
parent 6698ca7300
commit ed3d0cd523
2 changed files with 15 additions and 3 deletions

View file

@ -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);
} }
} }

View file

@ -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);