diff --git a/sway/tree/arrange.c b/sway/tree/arrange.c index bdef56eaa..8424460cb 100644 --- a/sway/tree/arrange.c +++ b/sway/tree/arrange.c @@ -59,6 +59,8 @@ void arrange_output(struct sway_container *output) { container_damage_whole(output); } +static double GAPS = 20.0; + void arrange_workspace(struct sway_container *workspace) { if (config->reloading) { return; @@ -71,10 +73,10 @@ void arrange_workspace(struct sway_container *workspace) { struct wlr_box *area = &output->sway_output->usable_area; wlr_log(L_DEBUG, "Usable area for ws: %dx%d@%d,%d", area->width, area->height, area->x, area->y); - workspace->width = area->width; - workspace->height = area->height; - workspace->x = area->x; - workspace->y = area->y; + workspace->width = area->width - (2 * GAPS); + workspace->height = area->height - (2 * GAPS); + workspace->x = area->x + GAPS; + workspace->y = area->y + GAPS; wlr_log(L_DEBUG, "Arranging workspace '%s' at %f, %f", workspace->name, workspace->x, workspace->y); arrange_children_of(workspace); @@ -123,7 +125,7 @@ static void apply_horiz_layout(struct sway_container *parent) { child->y = parent->y + parent_offset; child->width = floor(child->width * scale); child->height = parent_height; - child_x += child->width; + child_x += child->width + GAPS; } // Make last child use remaining width of parent child->width = parent->x + parent->width - child->x; @@ -141,7 +143,7 @@ static void apply_vert_layout(struct sway_container *parent) { parent_offset = container_titlebar_height() * parent->parent->children->length; } - size_t parent_height = parent->height - parent_offset; + size_t parent_height = parent->height + parent_offset; // Calculate total height of children double total_height = 0; @@ -171,7 +173,7 @@ static void apply_vert_layout(struct sway_container *parent) { child->y = child_y; child->width = parent->width; child->height = floor(child->height * scale); - child_y += child->height; + child_y += child->height + GAPS; } // Make last child use remaining height of parent child->height = parent->y + parent_offset + parent_height - child->y;