aboutsummaryrefslogtreecommitdiff
path: root/sway/layout.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2016-10-11 08:24:38 -0400
committerGitHub <noreply@github.com>2016-10-11 08:24:38 -0400
commitce713efcd23b82a7d85c1976ddfbd46f08133ff6 (patch)
treec7e0986aa282c00bcc12cde70820ffbca07cb6b5 /sway/layout.c
parent9ad6fc592dd6bd5bf29e60b03186bba32f5c9fa3 (diff)
parent166c2a3687d2819184457490132dd0c109238873 (diff)
Merge pull request #945 from thejan2009/workspace_layout
Fixes dealing with workspace_layout and related bugs [rfc]
Diffstat (limited to 'sway/layout.c')
-rw-r--r--sway/layout.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/sway/layout.c b/sway/layout.c
index 4f2ea09a..8565113d 100644
--- a/sway/layout.c
+++ b/sway/layout.c
@@ -66,6 +66,11 @@ void add_child(swayc_t *parent, swayc_t *child) {
if (!parent->focused) {
parent->focused = child;
}
+
+ // wrap view into a container
+ if (parent->type == C_WORKSPACE && child->type == C_VIEW) {
+ new_container(child, parent->workspace_layout);
+ }
}
void insert_child(swayc_t *parent, swayc_t *child, int index) {
@@ -80,6 +85,11 @@ void insert_child(swayc_t *parent, swayc_t *child, int index) {
if (!parent->focused) {
parent->focused = child;
}
+
+ // wrap view into a container
+ if (parent->type == C_WORKSPACE && child->type == C_VIEW) {
+ new_container(child, parent->workspace_layout);
+ }
}
void add_floating(swayc_t *ws, swayc_t *child) {
@@ -302,7 +312,8 @@ void move_container(swayc_t *container, enum movement_direction dir) {
}
// Change parent layout if we need to
if (parent->children->length == 1 && parent->layout != layout) {
- parent->layout = layout;
+ swayc_change_layout(parent, layout);
+ /* parent->layout = layout; */
continue;
}
if (parent->type == C_WORKSPACE) {