Fix the error result of the fullscreen command

Changes the error result from CMD_INVALID to CMD_FAILURE, since
CMD_INVALID indicates an unknown command or parser error and neither
occurs where CMD_INVALID was used.
This commit is contained in:
mwenzkowski 2018-11-29 17:03:04 +01:00
parent fd37ded3a3
commit b5c92e5d3b

View file

@ -13,14 +13,14 @@ struct cmd_results *cmd_fullscreen(int argc, char **argv) {
return error;
}
if (!root->outputs->length) {
return cmd_results_new(CMD_INVALID, "fullscreen",
return cmd_results_new(CMD_FAILURE, "fullscreen",
"Can't run this command while there's no outputs connected.");
}
struct sway_node *node = config->handler_context.node;
struct sway_container *container = config->handler_context.container;
struct sway_workspace *workspace = config->handler_context.workspace;
if (node->type == N_WORKSPACE && workspace->tiling->length == 0) {
return cmd_results_new(CMD_INVALID, "fullscreen",
return cmd_results_new(CMD_FAILURE, "fullscreen",
"Can't fullscreen an empty workspace");
}
if (node->type == N_WORKSPACE) {