Kill left-over i3-nagbar processes on 'exit'

This commit is contained in:
Michael Stapelberg
2011-09-11 21:49:35 +01:00
parent 9b671bda83
commit d03dffe012
2 changed files with 30 additions and 0 deletions

View File

@ -163,6 +163,14 @@ static void xkb_got_event(EV_P_ struct ev_io *w, int revents) {
DLOG("Done\n");
}
/*
* Exit handler which destroys the main_loop. Will trigger cleanup handlers.
*
*/
static void i3_exit() {
ev_loop_destroy(main_loop);
}
int main(int argc, char *argv[]) {
//parse_cmd("[ foo ] attach, attach ; focus");
int screens;
@ -529,5 +537,9 @@ int main(int argc, char *argv[]) {
start_application(exec_always->command);
}
/* Make sure to destroy the event loop to invoke the cleeanup callbacks
* when calling exit() */
atexit(i3_exit);
ev_loop(main_loop, 0);
}