diff options
-rw-r--r-- | sway/layout.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/sway/layout.c b/sway/layout.c index 741addf1..a50f541c 100644 --- a/sway/layout.c +++ b/sway/layout.c | |||
@@ -88,12 +88,16 @@ void add_floating(swayc_t *ws, swayc_t *child) { | |||
88 | } | 88 | } |
89 | } | 89 | } |
90 | 90 | ||
91 | swayc_t *add_sibling(swayc_t *sibling, swayc_t *child) { | 91 | swayc_t *add_sibling(swayc_t *fixed, swayc_t *active) { |
92 | swayc_t *parent = sibling->parent; | 92 | swayc_t *parent = fixed->parent; |
93 | int i = index_child(sibling); | 93 | int i = index_child(fixed); |
94 | list_insert(parent->children, i+1, child); | 94 | if (fixed->is_floating) { |
95 | child->parent = parent; | 95 | list_insert(parent->floating, i + 1, active); |
96 | return child->parent; | 96 | } else { |
97 | list_insert(parent->children, i + 1, active); | ||
98 | } | ||
99 | active->parent = parent; | ||
100 | return active->parent; | ||
97 | } | 101 | } |
98 | 102 | ||
99 | swayc_t *replace_child(swayc_t *child, swayc_t *new_child) { | 103 | swayc_t *replace_child(swayc_t *child, swayc_t *new_child) { |