aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sway/layout.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sway/layout.c b/sway/layout.c
index a50f541c..23d99e35 100644
--- a/sway/layout.c
+++ b/sway/layout.c
@@ -106,8 +106,11 @@ swayc_t *replace_child(swayc_t *child, swayc_t *new_child) {
106 return NULL; 106 return NULL;
107 } 107 }
108 int i = index_child(child); 108 int i = index_child(child);
109 parent->children->items[i] = new_child; 109 if (child->is_floating) {
110 110 parent->floating->items[i] = new_child;
111 } else {
112 parent->children->items[i] = new_child;
113 }
111 // Set parent and focus for new_child 114 // Set parent and focus for new_child
112 new_child->parent = child->parent; 115 new_child->parent = child->parent;
113 if (child->parent->focused == child) { 116 if (child->parent->focused == child) {