diff --git a/src/output.c b/src/output.c index 73b15497..d215ff8a 100644 --- a/src/output.c +++ b/src/output.c @@ -522,14 +522,20 @@ render_osd(struct output *output, pixman_region32_t *damage, /* show on screen display (osd) on all outputs */ 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) { - 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 = { - .x = usable.x + (usable.width - server->osd->width) / 2, - .y = usable.y + (usable.height - server->osd->height) / 2, + .x = ol_output->x + o->wlr_output->width + / o->wlr_output->scale / 2, + .y = ol_output->y + o->wlr_output->height + / o->wlr_output->scale / 2, .width = server->osd->width, .height = server->osd->height, }; + box.x -= server->osd->width / 2; + box.y -= server->osd->height / 2; render_texture_helper(output, damage, &box, server->osd); } } diff --git a/src/view.c b/src/view.c index 5d55cb5d..1654c569 100644 --- a/src/view.c +++ b/src/view.c @@ -139,6 +139,12 @@ view_maximize(struct view *view, bool maximize) struct output *output = view_output(view); 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) { struct border border = ssd_thickness(view);