diff --git a/include/con.h b/include/con.h index 1abc09a0..5788aea2 100644 --- a/include/con.h +++ b/include/con.h @@ -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 diff --git a/src/con.c b/src/con.c index 6439b1ed..598033c7 100644 --- a/src/con.c +++ b/src/con.c @@ -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); diff --git a/src/floating.c b/src/floating.c index 85b2c0ae..89350f94 100644 --- a/src/floating.c +++ b/src/floating.c @@ -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: don’t influence focus handling when Con was not focused before. con_focus(con); } diff --git a/src/tree.c b/src/tree.c index 1f477133..bff101df 100644 --- a/src/tree.c +++ b/src/tree.c @@ -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)) {