diff options
author | taiyu <[email protected]> | 2015-08-20 04:47:36 -0700 |
---|---|---|
committer | taiyu <[email protected]> | 2015-08-20 04:47:36 -0700 |
commit | fbaa9111a8525daeef8a5534784da2f793917a36 (patch) | |
tree | 19c6150da805f3c765746740f0eb8f250682292c /sway/container.c | |
parent | ba6034e8c8cd2bbe15f318e511817e0904633bb3 (diff) |
setup for resizable windows, drop weight
Diffstat (limited to 'sway/container.c')
-rw-r--r-- | sway/container.c | 9 |
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) { c->handle = -1; c->layout = L_NONE; c->type = type; - c->weight = 1; if (type != C_VIEW) { c->children = create_list(); } @@ -172,6 +171,14 @@ swayc_t *new_view(swayc_t *sibling, wlc_handle handle) { view->name = title ? strdup(title) : NULL; view->visible = true; view->is_focused = true; + //Setup geometry + view->width = sibling->parent->width; + view->height = sibling->parent->height; + if (sibling->parent->layout == L_HORIZ) { + view->width /= sibling->parent->children->length; + } else { + view->height /= sibling->parent->children->length; + } view->gaps = config->gaps_inner; |