aboutsummaryrefslogtreecommitdiff
path: root/sway/layout.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/layout.c')
-rw-r--r--sway/layout.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sway/layout.c b/sway/layout.c
index c53b9dad..1bc65050 100644
--- a/sway/layout.c
+++ b/sway/layout.c
@@ -73,11 +73,12 @@ swayc_t *remove_child(swayc_t *parent, swayc_t *child) {
break;
}
}
- }
- for (i = 0; i < parent->children->length; ++i) {
- if (parent->children->items[i] == child) {
- list_del(parent->children, i);
- break;
+ } else {
+ for (i = 0; i < parent->children->length; ++i) {
+ if (parent->children->items[i] == child) {
+ list_del(parent->children, i);
+ break;
+ }
}
}
if (parent->focused == child) {