From 83f6618e68f58dfa1230c8efaef678c4d3af4c0e Mon Sep 17 00:00:00 2001 From: Johan Malm Date: Mon, 8 Mar 2021 07:05:47 +0000 Subject: [PATCH] output: set layout-coords coorectly for cycle box --- src/output.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/output.c b/src/output.c index c4bf5745..49199a03 100644 --- a/src/output.c +++ b/src/output.c @@ -373,14 +373,21 @@ static void render_cycle_box(struct output *output, pixman_region32_t *output_damage, struct view *view) { - struct wlr_output_layout *layout = output->server->output_layout; - double ox = 0, oy = 0; - struct wlr_box box; - wlr_output_layout_output_coords(layout, output->wlr_output, &ox, &oy); - box.x = view->x - view->margin.left + ox; - box.y = view->y - view->margin.top + oy; - box.width = view->w + view->margin.left + view->margin.right; - box.height = view->h + view->margin.top + view->margin.bottom; + struct wlr_box box = { + .x = view->x, + .y = view->y, + .width = view->w, + .height = view->h, + }; + if (rc.xdg_shell_server_side_deco) { + box.x -= view->margin.left; + box.y -= view->margin.top; + box.width += view->margin.left + view->margin.right; + box.height += view->margin.top + view->margin.bottom; + } else if (!view->maximized) { + box.x -= view->padding.left; + box.y -= view->padding.top; + } float white[4] = { 1.0f, 1.0f, 1.0f, 1.0f }; float black[4] = { 0.0f, 0.0f, 0.0f, 1.0f };