diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-09-05 21:14:19 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-05 21:14:19 -0400 |
commit | f25588113435abdc3b6f9729897e92387f400340 (patch) | |
tree | 69d8d2b3f1e1b71fdb855ebb1074a0953154f9c7 /sway/tree/arrange.c | |
parent | 85e95d5825cdd24cc9a3c8efc2078c414300a8af (diff) | |
parent | c6368febc8045ce884cc0047e89b980d6a81ce2f (diff) | |
download | sway-f25588113435abdc3b6f9729897e92387f400340.tar.xz |
Merge pull request #2579 from RyanDwyer/adjust-container-box
Adjust container box
Diffstat (limited to 'sway/tree/arrange.c')
-rw-r--r-- | sway/tree/arrange.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sway/tree/arrange.c b/sway/tree/arrange.c index edb05f86..d50be25d 100644 --- a/sway/tree/arrange.c +++ b/sway/tree/arrange.c @@ -97,15 +97,14 @@ static void apply_tabbed_layout(list_t *children, struct wlr_box *parent) { if (!children->length) { return; } - size_t parent_offset = container_titlebar_height(); - size_t parent_height = parent->height - parent_offset; for (int i = 0; i < children->length; ++i) { struct sway_container *child = children->items[i]; + size_t parent_offset = child->view ? 0 : container_titlebar_height(); container_remove_gaps(child); child->x = parent->x; child->y = parent->y + parent_offset; child->width = parent->width; - child->height = parent_height; + child->height = parent->height - parent_offset; container_add_gaps(child); } } @@ -114,15 +113,15 @@ static void apply_stacked_layout(list_t *children, struct wlr_box *parent) { if (!children->length) { return; } - size_t parent_offset = container_titlebar_height() * children->length; - size_t parent_height = parent->height - parent_offset; for (int i = 0; i < children->length; ++i) { struct sway_container *child = children->items[i]; + size_t parent_offset = child->view ? 0 : + container_titlebar_height() * children->length; container_remove_gaps(child); child->x = parent->x; child->y = parent->y + parent_offset; child->width = parent->width; - child->height = parent_height; + child->height = parent->height - parent_offset; container_add_gaps(child); } } |