]> git.lizzy.rs Git - bspwm.git/commitdiff
Alternate auto scheme: Try to find a *full* split
authorBastien Dejean <nihilhill@gmail.com>
Mon, 11 Feb 2019 16:30:14 +0000 (17:30 +0100)
committerBastien Dejean <nihilhill@gmail.com>
Mon, 11 Feb 2019 16:30:14 +0000 (17:30 +0100)
Fixes #923.

src/tree.c

index 8bdae318f33962b4fc71977ac8a9e8ea54ad0c48..cc9099dd554a9bee7574048bf0c29c3aa60837c2 100644 (file)
@@ -348,7 +348,14 @@ node_t *insert_node(monitor_t *m, desktop_t *d, node_t *n, node_t *f)
                                                c->split_type = TYPE_HORIZONTAL;
                                        }
                                } else {
-                                       if (p->split_type == TYPE_HORIZONTAL) {
+                                       node_t *q = p;
+                                       while (q != NULL && (q->first_child->vacant || q->second_child->vacant)) {
+                                               q = q->parent;
+                                       }
+                                       if (q == NULL) {
+                                               q = p;
+                                       }
+                                       if (q->split_type == TYPE_HORIZONTAL) {
                                                c->split_type = TYPE_VERTICAL;
                                        } else {
                                                c->split_type = TYPE_HORIZONTAL;