diff options
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) { | |||
97 | if (!children->length) { | 97 | if (!children->length) { |
98 | return; | 98 | return; |
99 | } | 99 | } |
100 | size_t parent_offset = container_titlebar_height(); | ||
101 | size_t parent_height = parent->height - parent_offset; | ||
102 | for (int i = 0; i < children->length; ++i) { | 100 | for (int i = 0; i < children->length; ++i) { |
103 | struct sway_container *child = children->items[i]; | 101 | struct sway_container *child = children->items[i]; |
102 | size_t parent_offset = child->view ? 0 : container_titlebar_height(); | ||
104 | container_remove_gaps(child); | 103 | container_remove_gaps(child); |
105 | child->x = parent->x; | 104 | child->x = parent->x; |
106 | child->y = parent->y + parent_offset; | 105 | child->y = parent->y + parent_offset; |
107 | child->width = parent->width; | 106 | child->width = parent->width; |
108 | child->height = parent_height; | 107 | child->height = parent->height - parent_offset; |
109 | container_add_gaps(child); | 108 | container_add_gaps(child); |
110 | } | 109 | } |
111 | } | 110 | } |
@@ -114,15 +113,15 @@ static void apply_stacked_layout(list_t *children, struct wlr_box *parent) { | |||
114 | if (!children->length) { | 113 | if (!children->length) { |
115 | return; | 114 | return; |
116 | } | 115 | } |
117 | size_t parent_offset = container_titlebar_height() * children->length; | ||
118 | size_t parent_height = parent->height - parent_offset; | ||
119 | for (int i = 0; i < children->length; ++i) { | 116 | for (int i = 0; i < children->length; ++i) { |
120 | struct sway_container *child = children->items[i]; | 117 | struct sway_container *child = children->items[i]; |
118 | size_t parent_offset = child->view ? 0 : | ||
119 | container_titlebar_height() * children->length; | ||
121 | container_remove_gaps(child); | 120 | container_remove_gaps(child); |
122 | child->x = parent->x; | 121 | child->x = parent->x; |
123 | child->y = parent->y + parent_offset; | 122 | child->y = parent->y + parent_offset; |
124 | child->width = parent->width; | 123 | child->width = parent->width; |
125 | child->height = parent_height; | 124 | child->height = parent->height - parent_offset; |
126 | container_add_gaps(child); | 125 | container_add_gaps(child); |
127 | } | 126 | } |
128 | } | 127 | } |