Bugfix: Re-attach floating cons to the right container (Thanks mseed)

This fixes #315.
This commit is contained in:
Michael Stapelberg 2011-02-28 17:23:50 +01:00
parent beaa85ceb9
commit d80105103c
1 changed files with 5 additions and 1 deletions

View File

@ -158,7 +158,11 @@ void floating_disable(Con *con, bool automatic) {
/* 3: re-attach to the parent of the currently focused con on the workspace /* 3: re-attach to the parent of the currently focused con on the workspace
* this floating con was on */ * this floating con was on */
Con *focused = con_descend_focused(con_get_workspace(con)); Con *focused = con_descend_focused(con_get_workspace(con));
con->parent = focused->parent; /* if there is no other container on this workspace, focused will be the
* workspace itself */
if (focused->type == CT_WORKSPACE)
con->parent = focused;
else con->parent = focused->parent;
/* XXX: We adjust the percentage value to start with a fair value. Floating /* 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 * cons always have 1.0 as percent which doesnt work so well when