From: Fernando Tarlá Cardoso Lemos Date: Tue, 25 Jan 2011 23:49:22 +0000 (-0200) Subject: Only fix the percentages after we insert the container. X-Git-Tag: tree-pr2~105 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a93f4643ecfc9b8ad9d806090e531fb125906e4b;p=i3%2Fi3 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. --- diff --git a/src/tree.c b/src/tree.c index 48a25eb2..1f477133 100644 --- a/src/tree.c +++ b/src/tree.c @@ -71,11 +71,13 @@ Con *tree_open_con(Con *con) { 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); - /* 4: add a new container leaf to this con */ - Con *new = con_new(con); + /* 5: focus the new container */ con_focus(new); return new;