mirror of
https://github.com/gwenhael-le-moine/sway-patched-tray-menu.git
synced 2024-12-28 22:23:42 +01:00
Merge pull request #3581 from c-edw/ValidateConfigNoInitialize
If validating the config, do it as early as possible.
This commit is contained in:
commit
1fde9a9355
1 changed files with 12 additions and 11 deletions
23
sway/main.c
23
sway/main.c
|
@ -312,6 +312,18 @@ int main(int argc, char **argv) {
|
|||
wlr_log_init(WLR_ERROR, NULL);
|
||||
}
|
||||
|
||||
log_kernel();
|
||||
log_distro();
|
||||
log_env();
|
||||
detect_proprietary(allow_unsupported_gpu);
|
||||
detect_raspi();
|
||||
|
||||
if (validate) {
|
||||
bool valid = load_main_config(config_path, false, true);
|
||||
free(config_path);
|
||||
return valid ? 0 : 1;
|
||||
}
|
||||
|
||||
if (optind < argc) { // Behave as IPC client
|
||||
if (optind != 1) {
|
||||
sway_log(SWAY_ERROR, "Don't use options with the IPC client");
|
||||
|
@ -334,11 +346,6 @@ int main(int argc, char **argv) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
log_kernel();
|
||||
log_distro();
|
||||
detect_proprietary(allow_unsupported_gpu);
|
||||
detect_raspi();
|
||||
|
||||
if (!drop_permissions()) {
|
||||
server_fini(&server);
|
||||
exit(EXIT_FAILURE);
|
||||
|
@ -359,12 +366,6 @@ int main(int argc, char **argv) {
|
|||
}
|
||||
|
||||
ipc_init(&server);
|
||||
log_env();
|
||||
|
||||
if (validate) {
|
||||
bool valid = load_main_config(config_path, false, true);
|
||||
return valid ? 0 : 1;
|
||||
}
|
||||
|
||||
setenv("WAYLAND_DISPLAY", server.socket, true);
|
||||
if (!load_main_config(config_path, false, false)) {
|
||||
|
|
Loading…
Reference in a new issue