Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'vanilla/next' into gaps-next
Browse files Browse the repository at this point in the history
  • Loading branch information
Airblader committed Oct 8, 2019
2 parents b5a4373 + 465447a commit 36fc859
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/con.c
Expand Up @@ -1312,8 +1312,8 @@ bool con_move_to_mark(Con *con, const char *mark) {
return true;
}

if (target->type == CT_WORKSPACE) {
DLOG("target container is a workspace, simply moving the container there.\n");
if (target->type == CT_WORKSPACE && con_is_leaf(target)) {
DLOG("target container is an empty workspace, simply moving the container there.\n");
con_move_to_workspace(con, target, true, false, false);
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion testcases/lib/i3test.pm.in
Expand Up @@ -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";
}
Expand Down
1 change: 1 addition & 0 deletions testcases/t/243-move-to-mark.t
Expand Up @@ -361,6 +361,7 @@ does_i3_live;
###############################################################################
# Given 'S' and 'M' where 'M' is a workspace and 'S' is on a different
# workspace, then 'S' ends up as a tiling container on 'M'.
# See issue: #2003
###############################################################################

fresh_workspace;
Expand Down
37 changes: 37 additions & 0 deletions testcases/t/306-move-to-parent.t
@@ -0,0 +1,37 @@
#!perl
# vim:ts=4:sw=4:expandtab
#
# Please read the following documents before working on tests:
# • https://build.i3wm.org/docs/testsuite.html
# (or docs/testsuite)
#
# • https://build.i3wm.org/docs/lib-i3test.html
# (alternatively: perldoc ./testcases/lib/i3test.pm)
#
# • https://build.i3wm.org/docs/ipc.html
# (or docs/ipc)
#
# • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
# (unless you are already familiar with Perl)
#
# Make sure the trick used to move the container to its parent works.
# https://github.com/i3/i3/issues/1326#issuecomment-349082811
use i3test;

cmp_tree(
msg => 'Move to parent when the parent is a workspace',
layout_before => 'a H[b*] c',
layout_after => 'a b* c',
cb => sub {
cmd 'mark _a, focus parent, focus parent, mark _b, [con_mark=_a] move window to mark _b, [con_mark=_a] focus';
});

cmp_tree(
msg => 'Move to parent when the parent is a split',
layout_before => 'V[a H[b*] c]',
layout_after => 'V[a b* c]',
cb => sub {
cmd 'mark _a, focus parent, focus parent, mark _b, [con_mark=_a] move window to mark _b, [con_mark=_a] focus';
});

done_testing;

0 comments on commit 36fc859

Please sign in to comment.