From db61d581a3bfab0fd895344ccd6efec181a0b20b Mon Sep 17 00:00:00 2001 From: ppascher Date: Thu, 25 Oct 2018 19:24:01 +0200 Subject: [PATCH 1/2] Update workspace.c Remove output requirement for workspace command --- sway/commands/workspace.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sway/commands/workspace.c b/sway/commands/workspace.c index 8364e607e..745b40c7f 100644 --- a/sway/commands/workspace.c +++ b/sway/commands/workspace.c @@ -38,10 +38,6 @@ struct cmd_results *cmd_workspace(int argc, char **argv) { if ((error = checkarg(argc, "workspace", EXPECTED_AT_LEAST, 1))) { return error; } - if (!root->outputs->length) { - return cmd_results_new(CMD_INVALID, "workspace", - "Can't run this command while there's no outputs connected."); - } int output_location = -1; int gaps_location = -1; From 2123dfa15f32a1f3abde597c8ba0b3698761be31 Mon Sep 17 00:00:00 2001 From: ppascher Date: Thu, 25 Oct 2018 19:48:45 +0200 Subject: [PATCH 2/2] Update workspace.c re-added missing output check after config load --- sway/commands/workspace.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sway/commands/workspace.c b/sway/commands/workspace.c index 745b40c7f..5abbb6762 100644 --- a/sway/commands/workspace.c +++ b/sway/commands/workspace.c @@ -108,6 +108,9 @@ struct cmd_results *cmd_workspace(int argc, char **argv) { } else { if (config->reading || !config->active) { return cmd_results_new(CMD_DEFER, "workspace", NULL); + } else if (!root->outputs->length) { + return cmd_results_new(CMD_INVALID, "workspace", + "Can't run this command while there's no outputs connected."); } bool no_auto_back_and_forth = false;