]> git.lizzy.rs Git - bspwm.git/commitdiff
Skip insertion point if the brother is vacant
authorBastien Dejean <nihilhill@gmail.com>
Sat, 27 Jan 2018 10:49:01 +0000 (11:49 +0100)
committerBastien Dejean <nihilhill@gmail.com>
Sat, 27 Jan 2018 10:49:01 +0000 (11:49 +0100)
Fixes #719.
Closes #765.

src/tree.c

index 50406f41ed8addc13f870492dc600868a6ba0eaf..bb7bef84768fffb614c59d13a6803c9aa35393c5 100644 (file)
@@ -328,7 +328,7 @@ node_t *insert_node(monitor_t *m, desktop_t *d, node_t *n, node_t *f)
                                presel_dir(m, d, f, (rect.width >= rect.height ? DIR_EAST : DIR_SOUTH));
                        }
                }
-               if (f->presel == NULL && p != NULL && p->vacant) {
+               while (f->presel == NULL && p != NULL && (f->vacant || brother_tree(f)->vacant)) {
                        f = p;
                        p = f->parent;
                }