commit cd64df9b3a9bbe7ae47d0f431d6968289eb1b0a4
parent 7d823fbcaeba35cf633d3d46a1eb178720cfce85
Author: Drew DeVault <sir@cmpwn.com>
Date: Fri, 7 Oct 2016 16:37:02 -0400
Merge pull request #938 from alkino/fix_sibling
Fix creating of sibling floating/children
Diffstat:
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/sway/layout.c b/sway/layout.c
@@ -99,11 +99,20 @@ void add_floating(swayc_t *ws, swayc_t *child) {
swayc_t *add_sibling(swayc_t *fixed, swayc_t *active) {
swayc_t *parent = fixed->parent;
- int i = index_child(fixed);
if (fixed->is_floating) {
- list_insert(parent->floating, i + 1, active);
+ if (active->is_floating) {
+ int i = index_child(fixed);
+ list_insert(parent->floating, i + 1, active);
+ } else {
+ list_add(parent->children, active);
+ }
} else {
- list_insert(parent->children, i + 1, active);
+ if (active->is_floating) {
+ list_add(parent->floating, active);
+ } else {
+ int i = index_child(fixed);
+ list_insert(parent->children, i + 1, active);
+ }
}
active->parent = parent;
// focus new child