Bugfix: Insert container at the correct position on workspace-level when workspace_layout == default

Fixes #533

The problem was that the code was always executed. While it *attaches* the new
container to the workspace container, it also sets current = NULL and thus
always appends the container instead of inserting it after the currently
focused child. So now, we just don’t execute that code at all for
workspace_layout == default.
This commit is contained in:
Michael Stapelberg 2011-11-08 20:37:24 +00:00
parent 715fe580af
commit 26ab2ac008
1 changed files with 3 additions and 1 deletions

View File

@ -129,7 +129,9 @@ void con_attach(Con *con, Con *parent, bool ignore_focus) {
* workspace or a new split container with the configured
* workspace_layout).
*/
if (con->window != NULL && parent->type == CT_WORKSPACE) {
if (con->window != NULL &&
parent->type == CT_WORKSPACE &&
config.default_layout != L_DEFAULT) {
DLOG("Parent is a workspace. Applying default layout...\n");
Con *target = workspace_attach_to(parent);