Only fix the percentages after we insert the container.

This is what floating.c does and it allows us to unify the logic that
calculates those percentages.
This commit is contained in:
Fernando Tarlá Cardoso Lemos 2011-01-25 21:49:22 -02:00 committed by Michael Stapelberg
parent 89917976c7
commit a93f4643ec
1 changed files with 5 additions and 3 deletions

View File

@ -71,11 +71,13 @@ Con *tree_open_con(Con *con) {
assert(con != NULL); assert(con != NULL);
/* 3: re-calculate child->percent for each child */ /* 3. create the container and attach it to its parent */
Con *new = con_new(con);
/* 4: re-calculate child->percent for each child */
con_fix_percent(con, WINDOW_ADD); con_fix_percent(con, WINDOW_ADD);
/* 4: add a new container leaf to this con */ /* 5: focus the new container */
Con *new = con_new(con);
con_focus(new); con_focus(new);
return new; return new;