Move container to marked workspace: refine corner case

This commit should fix "move con to parent" trick (see below) in the
case when con->parent->parent is a workspace.

The trick:

    mark _a, focus parent, focus parent, mark _b,
    [con_mark=_a] move window to mark _b, [con_mark=_a] focus

The trick got broken in commit 626af81232
in order to fix an i3 crash (#2003).  Reverting said commit fixes the
trick.  The crash is caused by the fact that empty workspace isn't
considered a split (checked in src/con.c:1324), so the moved window ends
up as a sibling of the target workspace, not as its child.
This commit is contained in:
Albert Safin
2019-10-07 06:13:43 +00:00
parent ba0868e593
commit beb96ad18c
4 changed files with 41 additions and 3 deletions

View File

@ -1230,7 +1230,7 @@ sub create_layout {
$r = $r . '{"swallows": [{';
$r = $r . '"class": "^' . "$char" . '$"';
$r = $r . '}]},';
$r = $r . '}]}' . ($depth == 0 ? "\n" : ',');
} else {
die "Could not understand $char";
}