aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2016-10-07 16:37:02 -0400
committerDrew DeVault <sir@cmpwn.com>2016-10-12 21:42:57 -0400
commit59babac69d35284a39865243a7e067604abeeaec (patch)
tree896ee887cc0f7ee5192aaebba19a0d99d638523b
parentf1c5ba0a10a5e95c6ea20001d1d7c632bf898811 (diff)
downloadsway-59babac69d35284a39865243a7e067604abeeaec.zip
sway-59babac69d35284a39865243a7e067604abeeaec.tar.gz
sway-59babac69d35284a39865243a7e067604abeeaec.tar.bz2
Merge pull request #938 from alkino/fix_sibling
Fix creating of sibling floating/children
-rw-r--r--sway/layout.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/sway/layout.c b/sway/layout.c
index 3629df2..4f2ea09 100644
--- 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