diff options
author | Drew DeVault <sir@cmpwn.com> | 2016-10-07 16:37:02 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-07 16:37:02 -0400 |
commit | cd64df9b3a9bbe7ae47d0f431d6968289eb1b0a4 (patch) | |
tree | 5f8815ab93e8417a55576b3cbd22a2915fcb154f | |
parent | Merge pull request #937 from alkino/fix_scale_factor (diff) | |
parent | Fix creating of sibling floating/children (diff) | |
download | sway-cd64df9b3a9bbe7ae47d0f431d6968289eb1b0a4.tar.gz sway-cd64df9b3a9bbe7ae47d0f431d6968289eb1b0a4.tar.zst sway-cd64df9b3a9bbe7ae47d0f431d6968289eb1b0a4.zip |
Merge pull request #938 from alkino/fix_sibling
Fix creating of sibling floating/children
-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 |