diff options
author | D.B <thejan.2009@gmail.com> | 2016-10-11 09:11:56 +0200 |
---|---|---|
committer | D.B <thejan.2009@gmail.com> | 2016-10-11 09:16:59 +0200 |
commit | 166c2a3687d2819184457490132dd0c109238873 (patch) | |
tree | 13d40041fc41a2ba8d4f03ce403395334f8397d4 /sway/layout.c | |
parent | 571321a1d84a1eb2867fbdc39f7f828aa2c64a01 (diff) |
generalize wrapping views under workspaces
Diffstat (limited to 'sway/layout.c')
-rw-r--r-- | sway/layout.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sway/layout.c b/sway/layout.c index a57306e0..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) { |