diff options
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) { | |||
66 | if (!parent->focused) { | 66 | if (!parent->focused) { |
67 | parent->focused = child; | 67 | parent->focused = child; |
68 | } | 68 | } |
69 | |||
70 | // wrap view into a container | ||
71 | if (parent->type == C_WORKSPACE && child->type == C_VIEW) { | ||
72 | new_container(child, parent->workspace_layout); | ||
73 | } | ||
69 | } | 74 | } |
70 | 75 | ||
71 | void insert_child(swayc_t *parent, swayc_t *child, int index) { | 76 | 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) { | |||
80 | if (!parent->focused) { | 85 | if (!parent->focused) { |
81 | parent->focused = child; | 86 | parent->focused = child; |
82 | } | 87 | } |
88 | |||
89 | // wrap view into a container | ||
90 | if (parent->type == C_WORKSPACE && child->type == C_VIEW) { | ||
91 | new_container(child, parent->workspace_layout); | ||
92 | } | ||
83 | } | 93 | } |
84 | 94 | ||
85 | void add_floating(swayc_t *ws, swayc_t *child) { | 95 | void add_floating(swayc_t *ws, swayc_t *child) { |