summaryrefslogtreecommitdiffstats
path: root/sway/container.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/container.c')
-rw-r--r--sway/container.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sway/container.c b/sway/container.c
index 9c6b78e9..c9163784 100644
--- a/sway/container.c
+++ b/sway/container.c
@@ -14,7 +14,6 @@ static swayc_t *new_swayc(enum swayc_types type) {
14 c->handle = -1; 14 c->handle = -1;
15 c->layout = L_NONE; 15 c->layout = L_NONE;
16 c->type = type; 16 c->type = type;
17 c->weight = 1;
18 if (type != C_VIEW) { 17 if (type != C_VIEW) {
19 c->children = create_list(); 18 c->children = create_list();
20 } 19 }
@@ -172,6 +171,14 @@ swayc_t *new_view(swayc_t *sibling, wlc_handle handle) {
172 view->name = title ? strdup(title) : NULL; 171 view->name = title ? strdup(title) : NULL;
173 view->visible = true; 172 view->visible = true;
174 view->is_focused = true; 173 view->is_focused = true;
174 //Setup geometry
175 view->width = sibling->parent->width;
176 view->height = sibling->parent->height;
177 if (sibling->parent->layout == L_HORIZ) {
178 view->width /= sibling->parent->children->length;
179 } else {
180 view->height /= sibling->parent->children->length;
181 }
175 182
176 view->gaps = config->gaps_inner; 183 view->gaps = config->gaps_inner;
177 184