Workspace renaming: Interpret outputs as nondirectional

Currently when renaming outputs, an output assignment of "left" will
cause the workspace to move left. Treat this assignment as a proper name
instead (even though it is unlikely an output will be named "left").

Move logic for determining output to move to out of
`workspace_move_to_output`

Add test for ignoring direcionality during rename.

Fixes #3208.
This commit is contained in:
Oliver Graff
2018-03-31 15:56:59 -04:00
parent bc760c2036
commit e4a184e77e
4 changed files with 36 additions and 11 deletions

View File

@ -28,6 +28,7 @@ workspace 1 output fake-0
workspace 2 output fake-1
workspace 3:foo output fake-1
workspace baz output fake-1
workspace 5 output left
EOT
my $i3 = i3(get_socket_path());
@ -82,4 +83,15 @@ cmd 'rename workspace to baz';
is(get_output_for_workspace('baz'), 'fake-1',
'Renaming the workspace to a number and name should move it to the assigned output');
##########################################################################
# Renaming a workspace so that it is assigned a directional output does
# not move the workspace or crash
##########################################################################
cmd 'focus output fake-0';
cmd 'workspace bar';
cmd 'rename workspace to 5';
is(get_output_for_workspace('5'), 'fake-0',
'Renaming the workspace to a workspace assigned to a directional output should not move the workspace');
done_testing;