aboutsummaryrefslogtreecommitdiff
path: root/sway/commands/workspace.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-10-25 20:10:41 +0200
committerGitHub <noreply@github.com>2018-10-25 20:10:41 +0200
commit37eb83940f1c5630dbafc8990d1340d55dd3f411 (patch)
tree6882f75fc0488f0564cb3428d2a5c2b5adcd06d0 /sway/commands/workspace.c
parent6b59533646ea50e843f594ba041109873e0db16b (diff)
parent2123dfa15f32a1f3abde597c8ba0b3698761be31 (diff)
Merge pull request #2980 from ppascher/allow_workspace_missing_output
Update workspace.c
Diffstat (limited to 'sway/commands/workspace.c')
-rw-r--r--sway/commands/workspace.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sway/commands/workspace.c b/sway/commands/workspace.c
index 8364e607..5abbb676 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;
@@ -112,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;