diff options
author | S. Christoffer Eliesen <christoffer@eliesen.no> | 2015-11-24 20:46:22 +0100 |
---|---|---|
committer | S. Christoffer Eliesen <christoffer@eliesen.no> | 2015-11-24 21:34:24 +0100 |
commit | 8aef255d5f69751dfdfbd3bc18e94507d1a004cd (patch) | |
tree | 9cce17382e6b6bbfa546cdec5886a947217a8356 /sway | |
parent | 53ec7a74b623373b185f24b0e203bce09518ab11 (diff) |
layout: add_sibling: Handle floating views properly.
This should fix #241.
Diffstat (limited to 'sway')
-rw-r--r-- | sway/layout.c | 16 |
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) { } } -swayc_t *add_sibling(swayc_t *sibling, swayc_t *child) { - swayc_t *parent = sibling->parent; - int i = index_child(sibling); - list_insert(parent->children, i+1, child); - child->parent = parent; - return child->parent; +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); + } else { + list_insert(parent->children, i + 1, active); + } + active->parent = parent; + return active->parent; } swayc_t *replace_child(swayc_t *child, swayc_t *new_child) { |