aboutsummaryrefslogtreecommitdiff
path: root/sway/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/main.c')
-rw-r--r--sway/main.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/sway/main.c b/sway/main.c
index 4a7e13c1..f37f086d 100644
--- a/sway/main.c
+++ b/sway/main.c
@@ -9,6 +9,15 @@
#include "config.h"
#include "log.h"
#include "handlers.h"
+#include "ipc.h"
+#include "sway.h"
+
+static bool terminate_request = false;
+
+void sway_terminate(void) {
+ terminate_request = true;
+ wlc_terminate();
+}
static void sigchld_handle(int signal);
@@ -99,11 +108,18 @@ int main(int argc, char **argv) {
free(config_path);
}
- wlc_run();
+ ipc_init();
+
+ if (!terminate_request) {
+ wlc_run();
+ }
+
if (devnull) {
fclose(devnull);
}
+ ipc_terminate();
+
return 0;
}