This parameter is no longer needed.

The algorithm is now always the same, doesn't matter if we're
adding or removing a container to/from its parent.
This commit is contained in:
Fernando Tarlá Cardoso Lemos 2011-01-25 22:12:43 -02:00 committed by Michael Stapelberg
parent 45227fba54
commit bc82fc7e9f
4 changed files with 6 additions and 7 deletions

View File

@ -112,8 +112,7 @@ void con_detach(Con *con);
* container.
*
*/
void con_fix_percent(Con *con, int action);
enum { WINDOW_ADD = 0, WINDOW_REMOVE = 1 };
void con_fix_percent(Con *con);
/**
* Toggles fullscreen mode for the given container. Fullscreen mode will not be

View File

@ -382,7 +382,7 @@ int con_num_children(Con *con) {
* container.
*
*/
void con_fix_percent(Con *con, int action) {
void con_fix_percent(Con *con) {
Con *child;
int children = con_num_children(con);

View File

@ -68,7 +68,7 @@ void floating_enable(Con *con, bool automatic) {
TAILQ_REMOVE(&(con->parent->nodes_head), con, nodes);
TAILQ_REMOVE(&(con->parent->focus_head), con, focused);
con_fix_percent(con->parent, WINDOW_REMOVE);
con_fix_percent(con->parent);
/* 2: create a new container to render the decoration on, add
* it as a floating window to the workspace */
@ -155,7 +155,7 @@ void floating_disable(Con *con, bool automatic) {
con->floating = FLOATING_USER_OFF;
con_fix_percent(con->parent, WINDOW_ADD);
con_fix_percent(con->parent);
// TODO: dont influence focus handling when Con was not focused before.
con_focus(con);
}

View File

@ -75,7 +75,7 @@ Con *tree_open_con(Con *con) {
Con *new = con_new(con);
/* 4: re-calculate child->percent for each child */
con_fix_percent(con, WINDOW_ADD);
con_fix_percent(con);
/* 5: focus the new container */
con_focus(new);
@ -145,7 +145,7 @@ void tree_close(Con *con, bool kill_window, bool dont_kill_parent) {
if (con->type != CT_FLOATING_CON) {
/* If the container is *not* floating, we might need to re-distribute
* percentage values for the resized containers. */
con_fix_percent(parent, WINDOW_REMOVE);
con_fix_percent(parent);
}
if (con_is_floating(con)) {