From f5ba5cbcf6b486ba8422245ed982f354ba84e2d2 Mon Sep 17 00:00:00 2001 From: Geoffrey Casper Date: Sat, 4 Jul 2020 12:28:19 -0400 Subject: Reload command now matches i3's implementation (cherry picked from commit ea3ba203cc65671d9bf9da5ddbc698b18ed7685c) --- sway/commands/reload.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'sway/commands/reload.c') diff --git a/sway/commands/reload.c b/sway/commands/reload.c index 19ec065c..3c994d54 100644 --- a/sway/commands/reload.c +++ b/sway/commands/reload.c @@ -22,7 +22,12 @@ static void do_reload(void *data) { list_add(bar_ids, strdup(bar->id)); } - if (!load_main_config(config->current_config_path, true, false)) { + const char *path = NULL; + if (config->user_config_path) { + path = config->current_config_path; + } + + if (!load_main_config(path, true, false)) { sway_log(SWAY_ERROR, "Error(s) reloading config"); list_free_items_and_destroy(bar_ids); return; @@ -55,7 +60,12 @@ struct cmd_results *cmd_reload(int argc, char **argv) { return error; } - if (!load_main_config(config->current_config_path, true, true)) { + const char *path = NULL; + if (config->user_config_path) { + path = config->current_config_path; + } + + if (!load_main_config(path, true, true)) { return cmd_results_new(CMD_FAILURE, "Error(s) reloading config."); } -- cgit v1.2.3-54-g00ecf