diff options
author | 2016-10-07 22:29:56 +0200 | |
---|---|---|
committer | 2016-10-07 22:29:56 +0200 | |
commit | 382d47e238afeb8edd02b97dc214748fa4a87036 (patch) | |
tree | 5f8815ab93e8417a55576b3cbd22a2915fcb154f /sway/layout.c | |
parent | Merge pull request #937 from alkino/fix_scale_factor (diff) | |
download | sway-382d47e238afeb8edd02b97dc214748fa4a87036.tar.gz sway-382d47e238afeb8edd02b97dc214748fa4a87036.tar.zst sway-382d47e238afeb8edd02b97dc214748fa4a87036.zip |
Fix creating of sibling floating/children
If we want to add a sibling of different type than current
container it failed. Because we add it to the wrong list
Diffstat (limited to 'sway/layout.c')
-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 |