this implements both the "move container to workspace back_and_forth" command
and movements to the same workspace when auto_back_and_forth is set.

it includes documentation and test suite additions by michael.

it also simplifies the workspace_show_by_name function (making use of
workspace_get accepting NULL pointers).
This commit is contained in:
chrysn
2012-09-04 10:51:18 +02:00
committed by Michael Stapelberg
parent a01bac13fe
commit e15e37f922
7 changed files with 133 additions and 3 deletions

View File

@ -47,6 +47,33 @@ ok(get_ws($second_ws)->{focused}, 'second workspace focused');
cmd qq|workspace "$second_ws"|;
ok(get_ws($second_ws)->{focused}, 'second workspace still focused');
################################################################################
# verify that 'move workspace back_and_forth' works as expected
################################################################################
cmd qq|workspace "$first_ws"|;
my $first_win = open_window;
cmd qq|workspace "$second_ws"|;
my $second_win = open_window;
is(@{get_ws_content($first_ws)}, 1, 'one container on ws 1 before moving');
cmd 'move workspace back_and_forth';
is(@{get_ws_content($first_ws)}, 2, 'two containers on ws 1 before moving');
my $third_win = open_window;
################################################################################
# verify that moving to the current ws is a no-op without
# workspace_auto_back_and_forth.
################################################################################
cmd qq|workspace "$first_ws"|;
is(@{get_ws_content($second_ws)}, 1, 'one container on ws 2 before moving');
cmd qq|move workspace "$first_ws"|;
is(@{get_ws_content($second_ws)}, 1, 'still one container');
exit_gracefully($pid);
#####################################################################
@ -72,6 +99,19 @@ ok(get_ws($third_ws)->{focused}, 'third workspace focused');
cmd qq|workspace "$third_ws"|;
ok(get_ws($second_ws)->{focused}, 'second workspace focused');
$first_win = open_window;
################################################################################
# verify that moving to the current ws moves to the previous one with
# workspace_auto_back_and_forth.
################################################################################
cmd qq|workspace "$first_ws"|;
$second_win = open_window;
is(@{get_ws_content($second_ws)}, 1, 'one container on ws 2 before moving');
cmd qq|move workspace "$first_ws"|;
is(@{get_ws_content($second_ws)}, 2, 'two containers on ws 2');
################################################################################
# Now see if "workspace number <number>" also works as expected with