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:
parent
45227fba54
commit
bc82fc7e9f
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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)) {
|
||||
|
|
Loading…
Reference in New Issue