summaryrefslogtreecommitdiffstats
path: root/sway
diff options
context:
space:
mode:
authorLibravatar S. Christoffer Eliesen <christoffer@eliesen.no>2015-11-24 20:46:22 +0100
committerLibravatar S. Christoffer Eliesen <christoffer@eliesen.no>2015-11-24 21:34:24 +0100
commit8aef255d5f69751dfdfbd3bc18e94507d1a004cd (patch)
tree9cce17382e6b6bbfa546cdec5886a947217a8356 /sway
parentMerge pull request #252 from sce/fix_binding_cmp (diff)
downloadsway-8aef255d5f69751dfdfbd3bc18e94507d1a004cd.tar.gz
sway-8aef255d5f69751dfdfbd3bc18e94507d1a004cd.tar.zst
sway-8aef255d5f69751dfdfbd3bc18e94507d1a004cd.zip
layout: add_sibling: Handle floating views properly.
This should fix #241.
Diffstat (limited to 'sway')
-rw-r--r--sway/layout.c16
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
91swayc_t *add_sibling(swayc_t *sibling, swayc_t *child) { 91swayc_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
99swayc_t *replace_child(swayc_t *child, swayc_t *new_child) { 103swayc_t *replace_child(swayc_t *child, swayc_t *new_child) {