view: add 'struct border margin'

Simplify various view interfaces as a result
This commit is contained in:
Johan Malm 2020-09-15 20:41:01 +01:00
parent 5a77c84fc8
commit 090e78b85a
9 changed files with 91 additions and 101 deletions

View file

@ -53,14 +53,10 @@ static void render_cycle_box(struct output *output)
}
return;
render_it:
if ((view->type == LAB_XWAYLAND_VIEW) || !rc.client_side_decorations) {
box = deco_max_extents(view);
} else {
box.x = view->x;
box.y = view->y;
box.width = view->w;
box.height = view->h;
}
box.x = view->x - view->margin.left;
box.y = view->y - view->margin.top;
box.width = view->w + view->margin.left + view->margin.right;
box.height = view->h + view->margin.top + view->margin.bottom;
struct draw_data dd = {
.renderer = view->server->renderer,
.transform_matrix = output->wlr_output->transform_matrix,