when re-inserting a floating con, start with a more fair percent value

This commit is contained in:
Michael Stapelberg 2011-01-27 15:53:14 +01:00
parent fe851b85f0
commit 2f5d111936
1 changed files with 7 additions and 0 deletions

View File

@ -151,6 +151,13 @@ void floating_disable(Con *con, bool automatic) {
/* 3: re-attach to previous parent */
con->parent = con_get_workspace(con);
/* XXX: We adjust the percentage value to start with a fair value. Floating
* cons always have 1.0 as percent which doesnt work so well when
* re-inserting (the formerly floating con would get 50% of the target
* con). */
con->percent = (1.0 / con_num_children(con->parent));
TAILQ_INSERT_TAIL(&(con->parent->nodes_head), con, nodes);
TAILQ_INSERT_TAIL(&(con->parent->focus_head), con, focused);