Replace the discrete 'split' Con property with a simple function.

This commit is contained in:
Deiz
2012-10-03 13:10:48 -04:00
committed by Michael Stapelberg
parent d7e5da8b39
commit fdcba7b91a
9 changed files with 33 additions and 30 deletions

View File

@ -382,7 +382,6 @@ void tree_split(Con *con, orientation_t orientation) {
TAILQ_REPLACE(&(parent->focus_head), con, new, focused);
new->parent = parent;
new->layout = (orientation == HORIZ) ? L_SPLITH : L_SPLITV;
new->split = true;
/* 3: swap 'percent' (resize factor) */
new->percent = con->percent;
@ -626,8 +625,8 @@ void tree_flatten(Con *con) {
/* The child must have a different orientation than the con but the same as
* the cons parent to be redundant */
if (!con->split ||
!child->split ||
if (!con_is_split(con) ||
!con_is_split(child) ||
con_orientation(con) == con_orientation(child) ||
con_orientation(child) != con_orientation(parent))
goto recurse;