summaryrefslogtreecommitdiffstats
path: root/sway/container.c
diff options
context:
space:
mode:
authorLibravatar taiyu <taiyu.len@gmail.com>2015-08-18 02:46:14 -0700
committerLibravatar taiyu <taiyu.len@gmail.com>2015-08-18 02:46:14 -0700
commit63bc0d3b5451f4668186c98a1f283f3e0a104cfe (patch)
treef86f88dc446e95702380687a48bba808029d7e1b /sway/container.c
parentmerged Luminarys resizing code (diff)
downloadsway-63bc0d3b5451f4668186c98a1f283f3e0a104cfe.tar.gz
sway-63bc0d3b5451f4668186c98a1f283f3e0a104cfe.tar.zst
sway-63bc0d3b5451f4668186c98a1f283f3e0a104cfe.zip
more changes
Diffstat (limited to 'sway/container.c')
-rw-r--r--sway/container.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sway/container.c b/sway/container.c
index 67132a48..2b9f7554 100644
--- a/sway/container.c
+++ b/sway/container.c
@@ -27,10 +27,7 @@ static void free_swayc(swayc_t *c) {
27 list_free(c->children); 27 list_free(c->children);
28 } 28 }
29 if (c->parent) { 29 if (c->parent) {
30 if (c->parent->focused == c) { 30 remove_child(c);
31 c->parent->focused = NULL;
32 }
33 remove_child(c->parent, c);
34 } 31 }
35 if (c->name) { 32 if (c->name) {
36 free(c->name); 33 free(c->name);
@@ -118,6 +115,11 @@ swayc_t *new_container(swayc_t *child, enum swayc_layouts layout) {
118 //reorder focus 115 //reorder focus
119 cont->focused = workspace->focused; 116 cont->focused = workspace->focused;
120 workspace->focused = cont; 117 workspace->focused = cont;
118 //set all children focu to container
119 int i;
120 for (i = 0; i < workspace->children->length; ++i) {
121 ((swayc_t *)workspace->children->items[i])->parent = cont;
122 }
121 //Swap children 123 //Swap children
122 list_t *tmp_list = workspace->children; 124 list_t *tmp_list = workspace->children;
123 workspace->children = cont->children; 125 workspace->children = cont->children;
@@ -204,7 +206,7 @@ swayc_t *destroy_output(swayc_t *output) {
204 if (output->children->length == 0) { 206 if (output->children->length == 0) {
205 //TODO move workspaces to other outputs 207 //TODO move workspaces to other outputs
206 } 208 }
207 sway_log(L_DEBUG, "OUTPUT: Destroying output '%u'", (unsigned int)output->handle); 209 sway_log(L_DEBUG, "OUTPUT: Destroying output '%lu'", output->handle);
208 free_swayc(output); 210 free_swayc(output);
209 return &root_container; 211 return &root_container;
210} 212}
@@ -246,7 +248,6 @@ swayc_t *destroy_view(swayc_t *view) {
246 if (parent->type == C_CONTAINER) { 248 if (parent->type == C_CONTAINER) {
247 return destroy_container(parent); 249 return destroy_container(parent);
248 } 250 }
249
250 return parent; 251 return parent;
251} 252}
252 253