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

@ -923,8 +923,8 @@ Con *workspace_encapsulate(Con *ws) {
* Move the given workspace to the specified output.
* This returns true if and only if moving the workspace was successful.
*/
bool workspace_move_to_output(Con *ws, const char *name) {
LOG("Trying to move workspace %p / %s to output \"%s\".\n", ws, ws->name, name);
bool workspace_move_to_output(Con *ws, Output *output) {
LOG("Trying to move workspace %p / %s to output %p / \"%s\".\n", ws, ws->name, output, output_primary_name(output));
Output *current_output = get_output_for_con(ws);
if (current_output == NULL) {
@ -932,12 +932,6 @@ bool workspace_move_to_output(Con *ws, const char *name) {
return false;
}
Output *output = get_output_from_string(current_output, name);
if (!output) {
ELOG("Could not get output from string \"%s\"\n", name);
return false;
}
Con *content = output_get_content(output->con);
LOG("got output %p with content %p\n", output, content);