From 5fdffea99ac5fcfd3618256a0291c9ff71cb1480 Mon Sep 17 00:00:00 2001 From: Rouven Czerwinski Date: Mon, 5 Nov 2018 20:28:59 +0100 Subject: [PATCH 1/2] commands/exec_always: defer command on config validation The exec_always command was executed twice, since it was not checking for the config->validating variable. Fix this by defering the command if the configuration is validating. Fixes #3072 --- sway/commands/exec_always.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sway/commands/exec_always.c b/sway/commands/exec_always.c index 8bdeceeb5..7a15709bd 100644 --- a/sway/commands/exec_always.c +++ b/sway/commands/exec_always.c @@ -15,7 +15,7 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) { struct cmd_results *error = NULL; - if (!config->active) return cmd_results_new(CMD_DEFER, NULL, NULL); + if (!config->active || config->validating) return cmd_results_new(CMD_DEFER, NULL, NULL); if ((error = checkarg(argc, argv[-1], EXPECTED_AT_LEAST, 1))) { return error; } From f54287eaf3f96e9574ebd4828788fd20be4b35dd Mon Sep 17 00:00:00 2001 From: Rouven Czerwinski Date: Mon, 5 Nov 2018 20:32:05 +0100 Subject: [PATCH 2/2] config: mention that reload message is also printed on validation --- sway/config.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sway/config.c b/sway/config.c index 9ec403679..7ef3ef382 100644 --- a/sway/config.c +++ b/sway/config.c @@ -389,7 +389,8 @@ bool load_main_config(const char *file, bool is_active, bool validating) { config_defaults(config); config->validating = validating; if (is_active) { - wlr_log(WLR_DEBUG, "Performing configuration file reload"); + wlr_log(WLR_DEBUG, "Performing configuration file %s", + validating ? "validation" : "reload"); config->reloading = true; config->active = true;