Bugfix: Switch to appropriate workspace when using 'focus' (+test) (Thanks rogutes)

Fixes #432
This commit is contained in:
Michael Stapelberg
2011-07-14 23:43:57 +02:00
parent 26d63fffc2
commit 2d71102796
5 changed files with 34 additions and 30 deletions

View File

@ -12,7 +12,7 @@ BEGIN {
my $x = X11::XCB::Connection->new;
my $i3 = i3("/tmp/nestedcons");
fresh_workspace;
my $tmp = fresh_workspace;
cmd 'split h';
@ -73,5 +73,17 @@ is($focus, $top->id, "Top window focused");
$focus = focus_after(qq|[con_mark="$random_mark" con_mark="$random_mark"] focus|);
is($focus, $mid->id, "goto worked");
#####################################################################
# Check whether the focus command will switch to a different
# workspace if necessary
#####################################################################
my $tmp2 = fresh_workspace;
is(focused_ws(), $tmp2, 'tmp2 now focused');
cmd qq|[con_mark="$random_mark"] focus|;
is(focused_ws(), $tmp, 'tmp now focused');
done_testing;