output: set layout-coords coorectly for cycle box

This commit is contained in:
Johan Malm 2021-03-08 07:05:47 +00:00
parent 6ece805e88
commit 83f6618e68

View file

@ -373,14 +373,21 @@ static void
render_cycle_box(struct output *output, pixman_region32_t *output_damage, render_cycle_box(struct output *output, pixman_region32_t *output_damage,
struct view *view) struct view *view)
{ {
struct wlr_output_layout *layout = output->server->output_layout; struct wlr_box box = {
double ox = 0, oy = 0; .x = view->x,
struct wlr_box box; .y = view->y,
wlr_output_layout_output_coords(layout, output->wlr_output, &ox, &oy); .width = view->w,
box.x = view->x - view->margin.left + ox; .height = view->h,
box.y = view->y - view->margin.top + oy; };
box.width = view->w + view->margin.left + view->margin.right; if (rc.xdg_shell_server_side_deco) {
box.height = view->h + view->margin.top + view->margin.bottom; 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 white[4] = { 1.0f, 1.0f, 1.0f, 1.0f };
float black[4] = { 0.0f, 0.0f, 0.0f, 1.0f }; float black[4] = { 0.0f, 0.0f, 0.0f, 1.0f };