Fixed dwindle on ultrawides
This commit is contained in:
parent
50fc8532be
commit
984bb8e293
1 changed files with 7 additions and 7 deletions
|
|
@ -3257,9 +3257,7 @@ dwindle_recalc(DwindleNode *n, int gap)
|
|||
return;
|
||||
}
|
||||
|
||||
/* Wider than tall -> split left/right; taller -> split top/bottom. */
|
||||
n->split_top = (n->box.height > n->box.width);
|
||||
|
||||
|
||||
if (!n->split_top) {
|
||||
int w1 = MAX(1, (int)(n->box.width / 2.0f * n->split_ratio) - gap / 2);
|
||||
n->children[0]->box = (struct wlr_box){
|
||||
|
|
@ -3341,17 +3339,20 @@ dwindle_insert(DwindleNode **root, Client *new_c, Client *focused, DwindleHint *
|
|||
if (!opening_on)
|
||||
opening_on = dwindle_first_leaf(*root);
|
||||
|
||||
int new_split_top = opening_on->parent
|
||||
? !opening_on->parent->split_top
|
||||
: (opening_on->box.height > opening_on->box.width);
|
||||
|
||||
if (hint) {
|
||||
int split_top = (opening_on->box.height > opening_on->box.width);
|
||||
hint->old_box = opening_on->box;
|
||||
hint->edge = split_top ? EDGE_BOTTOM : EDGE_RIGHT;
|
||||
hint->edge = new_split_top ? EDGE_BOTTOM : EDGE_RIGHT;
|
||||
}
|
||||
|
||||
DwindleNode *new_parent = dwindle_new_node();
|
||||
new_parent->is_node = 1;
|
||||
new_parent->box = opening_on->box;
|
||||
new_parent->parent = opening_on->parent;
|
||||
new_parent->split_top = (opening_on->box.height > opening_on->box.width);
|
||||
new_parent->split_top = new_split_top;
|
||||
new_parent->children[0] = opening_on;
|
||||
new_parent->children[1] = new_leaf;
|
||||
|
||||
|
|
@ -4219,4 +4220,3 @@ main(int argc, char *argv[])
|
|||
usage:
|
||||
die("Usage: %s [-v] [-d] [-s startup command] [-c config file]", argv[0]);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue