aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sway/container.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/sway/container.c b/sway/container.c
index d60aa6ff..442266ec 100644
--- a/sway/container.c
+++ b/sway/container.c
@@ -35,11 +35,8 @@ static void free_swayc(swayc_t *cont) {
35 list_free(cont->children); 35 list_free(cont->children);
36 } 36 }
37 if (cont->floating) { 37 if (cont->floating) {
38 if (cont->floating->length) { 38 while (cont->floating->length) {
39 int i; 39 free_swayc(cont->floating->items[0]);
40 for (i = 0; i < cont->floating->length; ++i) {
41 free_swayc(cont->floating->items[i]);
42 }
43 } 40 }
44 list_free(cont->floating); 41 list_free(cont->floating);
45 } 42 }
@@ -304,16 +301,14 @@ swayc_t *destroy_output(swayc_t *output) {
304 return NULL; 301 return NULL;
305 } 302 }
306 if (output->children->length > 0) { 303 if (output->children->length > 0) {
307 int i, len = root_container.children->length;
308 // TODO save workspaces when there are no outputs. 304 // TODO save workspaces when there are no outputs.
309 // TODO also check if there will ever be no outputs except for exiting 305 // TODO also check if there will ever be no outputs except for exiting
310 // program 306 // program
311 if (len > 1) { 307 if (root_container.children->length > 1) {
312 len = output->children->length;
313 int p = root_container.children->items[0] == output; 308 int p = root_container.children->items[0] == output;
314 // Move workspace from this output to another output 309 // Move workspace from this output to another output
315 for (i = 0; i < len; ++i) { 310 while (output->children->length) {
316 swayc_t *child = output->children->items[i]; 311 swayc_t *child = output->children->items[0];
317 remove_child(child); 312 remove_child(child);
318 add_child(root_container.children->items[p], child); 313 add_child(root_container.children->items[p], child);
319 } 314 }
@@ -651,6 +646,7 @@ void update_visibility(swayc_t *container) {
651} 646}
652 647
653void reset_gaps(swayc_t *view, void *data) { 648void reset_gaps(swayc_t *view, void *data) {
649 (void) data;
654 if (!ASSERT_NONNULL(view)) { 650 if (!ASSERT_NONNULL(view)) {
655 return; 651 return;
656 } 652 }