mirror of
https://github.com/swaywm/sway.git
synced 2025-11-06 13:29:50 -05:00
added sway_terminate to exit cleanly
This commit is contained in:
parent
70f046c87a
commit
f26ed32e46
5 changed files with 19 additions and 6 deletions
15
sway/main.c
15
sway/main.c
|
|
@ -10,6 +10,14 @@
|
|||
#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);
|
||||
|
||||
|
|
@ -102,12 +110,15 @@ int main(int argc, char **argv) {
|
|||
|
||||
ipc_init();
|
||||
|
||||
wlc_run();
|
||||
if (!terminate_request) {
|
||||
wlc_run();
|
||||
}
|
||||
|
||||
if (devnull) {
|
||||
fclose(devnull);
|
||||
}
|
||||
|
||||
ipc_shutdown();
|
||||
ipc_terminate();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue