diff options
Diffstat (limited to 'sway')
-rw-r--r-- | sway/layout.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/sway/layout.c b/sway/layout.c index 3629df24..4f2ea09a 100644 --- a/sway/layout.c +++ b/sway/layout.c | |||
@@ -99,11 +99,20 @@ void add_floating(swayc_t *ws, swayc_t *child) { | |||
99 | 99 | ||
100 | swayc_t *add_sibling(swayc_t *fixed, swayc_t *active) { | 100 | swayc_t *add_sibling(swayc_t *fixed, swayc_t *active) { |
101 | swayc_t *parent = fixed->parent; | 101 | swayc_t *parent = fixed->parent; |
102 | int i = index_child(fixed); | ||
103 | if (fixed->is_floating) { | 102 | if (fixed->is_floating) { |
104 | list_insert(parent->floating, i + 1, active); | 103 | if (active->is_floating) { |
104 | int i = index_child(fixed); | ||
105 | list_insert(parent->floating, i + 1, active); | ||
106 | } else { | ||
107 | list_add(parent->children, active); | ||
108 | } | ||
105 | } else { | 109 | } else { |
106 | list_insert(parent->children, i + 1, active); | 110 | if (active->is_floating) { |
111 | list_add(parent->floating, active); | ||
112 | } else { | ||
113 | int i = index_child(fixed); | ||
114 | list_insert(parent->children, i + 1, active); | ||
115 | } | ||
107 | } | 116 | } |
108 | active->parent = parent; | 117 | active->parent = parent; |
109 | // focus new child | 118 | // focus new child |