Make awesome.quit() during startup work

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2015-10-10 22:25:56 +02:00
parent b34a653448
commit 7ed29196bb
2 changed files with 8 additions and 3 deletions

View File

@ -621,9 +621,12 @@ main(int argc, char **argv)
g_main_context_set_poll_func(g_main_context_default(), &a_glib_poll); g_main_context_set_poll_func(g_main_context_default(), &a_glib_poll);
gettimeofday(&last_wakeup, NULL); gettimeofday(&last_wakeup, NULL);
/* main event loop */ /* main event loop (if not NULL, awesome.quit() was already called) */
globalconf.loop = g_main_loop_new(NULL, FALSE); if (globalconf.loop == NULL)
g_main_loop_run(globalconf.loop); {
globalconf.loop = g_main_loop_new(NULL, FALSE);
g_main_loop_run(globalconf.loop);
}
g_main_loop_unref(globalconf.loop); g_main_loop_unref(globalconf.loop);
globalconf.loop = NULL; globalconf.loop = NULL;

2
luaa.c
View File

@ -111,6 +111,8 @@ composite_manager_running(void)
static int static int
luaA_quit(lua_State *L) luaA_quit(lua_State *L)
{ {
if (globalconf.loop == NULL)
globalconf.loop = g_main_loop_new(NULL, FALSE);
g_main_loop_quit(globalconf.loop); g_main_loop_quit(globalconf.loop);
return 0; return 0;
} }