From b5c92e5d3b7c7f62c3e18f9286ca597c2bc344a0 Mon Sep 17 00:00:00 2001 From: mwenzkowski <29407878+mwenzkowski@users.noreply.github.com> Date: Thu, 29 Nov 2018 17:03:04 +0100 Subject: [PATCH 1/2] 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. --- sway/commands/fullscreen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sway/commands/fullscreen.c b/sway/commands/fullscreen.c index ff7cbba71..b78187d91 100644 --- a/sway/commands/fullscreen.c +++ b/sway/commands/fullscreen.c @@ -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) { From 68668c22e587c7f2210e2d073da8ee836980f27b Mon Sep 17 00:00:00 2001 From: mwenzkowski <29407878+mwenzkowski@users.noreply.github.com> Date: Fri, 30 Nov 2018 18:15:26 +0100 Subject: [PATCH 2/2] sway.5: Improve documentation Document the optional arguments of the fullscreen command. --- sway/sway.5.scd | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sway/sway.5.scd b/sway/sway.5.scd index 4edd16bf6..651c23022 100644 --- a/sway/sway.5.scd +++ b/sway/sway.5.scd @@ -130,8 +130,9 @@ They are expected to be used with *bindsym* or at runtime through *swaymsg*(1). *focus* mode\_toggle Moves focus between the floating and tiled layers. -*fullscreen* - Toggles fullscreen for the focused view. +*fullscreen* [enable|disable|toggle] + Makes focused view fullscreen, non-fullscreen, or the opposite of what it + is now. If no argument is given, it does the same as _toggle_. *gaps* inner|outer|horizontal|vertical|top|right|bottom|left all|current set|plus|minus