diff options
author | William McKinnon <[email protected]> | 2022-04-27 17:33:23 -0400 |
---|---|---|
committer | William McKinnon <[email protected]> | 2022-04-27 17:33:23 -0400 |
commit | 7460d9f565092836f81b917a040caff57142d91a (patch) | |
tree | b76e7facef2aaa5925a62ad6b9995c16663313f0 /sway/commands/focus.c | |
parent | c37aba2736e31264bdcd52147a96fa85e17c8c5f (diff) |
merge sway master
Diffstat (limited to 'sway/commands/focus.c')
-rw-r--r-- | sway/commands/focus.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/sway/commands/focus.c b/sway/commands/focus.c index b8d28480..facd82de 100644 --- a/sway/commands/focus.c +++ b/sway/commands/focus.c @@ -54,7 +54,7 @@ static bool get_direction_from_next_prev(struct sway_container *container, } else { return false; } - + return true; } @@ -285,7 +285,7 @@ static struct cmd_results *focus_mode(struct sway_workspace *ws, } } else { return cmd_results_new(CMD_FAILURE, - "Failed to find a %s container in workspace", + "Failed to find a %s container in workspace.", floating ? "floating" : "tiling"); } return cmd_results_new(CMD_SUCCESS, NULL); @@ -295,7 +295,7 @@ static struct cmd_results *focus_output(struct sway_seat *seat, int argc, char **argv) { if (!argc) { return cmd_results_new(CMD_INVALID, - "Expected 'focus output <direction|name>'"); + "Expected 'focus output <direction|name>'."); } char *identifier = join_args(argv, argc); struct sway_output *output = output_by_name_or_id(identifier); @@ -305,13 +305,13 @@ static struct cmd_results *focus_output(struct sway_seat *seat, if (!parse_direction(identifier, &direction)) { free(identifier); return cmd_results_new(CMD_INVALID, - "There is no output with that name"); + "There is no output with that name."); } struct sway_workspace *ws = seat_get_focused_workspace(seat); if (!ws) { free(identifier); return cmd_results_new(CMD_FAILURE, - "No focused workspace to base directions off of"); + "No focused workspace to base directions off of."); } output = output_get_in_direction(ws->output, direction); @@ -375,10 +375,14 @@ struct cmd_results *cmd_focus(int argc, char **argv) { struct sway_seat *seat = config->handler_context.seat; if (node->type < N_WORKSPACE) { return cmd_results_new(CMD_FAILURE, - "Command 'focus' cannot be used above the workspace level"); + "Command 'focus' cannot be used above the workspace level."); } - if (argc == 0 && container) { + if (argc == 0) { + if (!container) { + return cmd_results_new(CMD_FAILURE, "No container to focus was specified."); + } + if (container_is_scratchpad_hidden_or_child(container)) { root_scratchpad_show(container); } |