aboutsummaryrefslogtreecommitdiff
path: root/sway/commands
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-11-05 15:33:40 +0100
committerGitHub <noreply@github.com>2018-11-05 15:33:40 +0100
commitd0bb450681588a9ea6d612de6893daace996873c (patch)
treebb71746de04a3d2e67218cc41812e885f82b929f /sway/commands
parentbcbd0a9b45ea7d8969b58183a12240e74e90f9f0 (diff)
parent67866dc3785453ad0ac97d14858c9176cbcca966 (diff)
Merge pull request #3066 from mwenzkowski/fix-gaps
Improvements to the runtime only part of the gaps command
Diffstat (limited to 'sway/commands')
-rw-r--r--sway/commands/gaps.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sway/commands/gaps.c b/sway/commands/gaps.c
index ca8cb27a..3f0ef155 100644
--- a/sway/commands/gaps.c
+++ b/sway/commands/gaps.c
@@ -149,16 +149,17 @@ struct cmd_results *cmd_gaps(int argc, char **argv) {
return error;
}
+ bool config_loading = !config->active || config->reloading;
+
if (argc == 2) {
return gaps_set_defaults(argc, argv);
}
- if (argc == 4) {
- if (config->active) {
- return gaps_set_runtime(argc, argv);
- } else {
- return cmd_results_new(CMD_INVALID, "gaps",
- "This syntax can only be used when sway is running");
- }
+ if (argc == 4 && !config_loading) {
+ return gaps_set_runtime(argc, argv);
+ }
+ if (config_loading) {
+ return cmd_results_new(CMD_INVALID, "gaps",
+ "Expected 'gaps inner|outer <px>'");
}
return cmd_results_new(CMD_INVALID, "gaps",
"Expected 'gaps inner|outer <px>' or "