get_output_for_con: Assert result != NULL

- The result from con_get_output was always not NULL because
con_get_output asserts so
- get_output_by_name should always be able to get an output from the
corresponding container
- workspace_move_to_output doesn't return bool anymore since it can't
fail
This commit is contained in:
Orestis Floros
2019-03-21 23:51:57 +02:00
parent d0ab51db85
commit 351d891f4c
5 changed files with 5 additions and 33 deletions

View File

@ -1114,22 +1114,13 @@ void cmd_move_workspace_to_output(I3_CMD, const char *name) {
}
Output *current_output = get_output_for_con(ws);
if (current_output == NULL) {
yerror("Cannot get current output. This is a bug in i3.");
return;
}
Output *target_output = get_output_from_string(current_output, name);
if (!target_output) {
yerror("Could not get output from string \"%s\"", name);
return;
}
bool success = workspace_move_to_output(ws, target_output);
if (!success) {
yerror("Failed to move workspace to output.");
return;
}
workspace_move_to_output(ws, target_output);
}
cmd_output->needs_tree_render = true;