diff options
Diffstat (limited to 'sway/main.c')
-rw-r--r-- | sway/main.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/sway/main.c b/sway/main.c index de2445a8..c02caf42 100644 --- a/sway/main.c +++ b/sway/main.c @@ -22,6 +22,7 @@ #include "sway/debug.h" #include "sway/desktop/transaction.h" #include "sway/server.h" +#include "sway/swaynag.h" #include "sway/tree/layout.h" #include "sway/ipc-server.h" #include "ipc-client.h" @@ -415,14 +416,13 @@ int main(int argc, char **argv) { ipc_init(&server); log_env(); - char *errors = NULL; if (validate) { - bool valid = load_main_config(config_path, false, &errors); - free(errors); + bool valid = load_main_config(config_path, false, true); return valid ? 0 : 1; } - if (!load_main_config(config_path, false, &errors)) { + setenv("WAYLAND_DISPLAY", server.socket, true); + if (!load_main_config(config_path, false, false)) { sway_terminate(EXIT_FAILURE); } @@ -432,10 +432,8 @@ int main(int argc, char **argv) { security_sanity_check(); - setenv("WAYLAND_DISPLAY", server.socket, true); if (!terminate_request) { if (!server_start_backend(&server)) { - free(errors); sway_terminate(EXIT_FAILURE); } } @@ -455,9 +453,8 @@ int main(int argc, char **argv) { } transaction_commit_dirty(); - if (errors) { - spawn_swaynag_config_errors(config, errors); - free(errors); + if (config->swaynag_config_errors.pid > 0) { + swaynag_show(&config->swaynag_config_errors); } if (!terminate_request) { |