forked from enlightenment/efl
ecore: Allow quitting the main loop before entering it
elementary_config does this, and the glib based main loop didn't support it. Signed-off-by: Mike McCormack <mj.mccormack@samsung.com> SVN revision: 65683
This commit is contained in:
parent
e08be28ccc
commit
f57db57c25
|
@ -207,9 +207,7 @@ static void _ecore_main_win32_handlers_cleanup(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int in_main_loop = 0;
|
static int in_main_loop = 0;
|
||||||
#ifndef USE_G_MAIN_LOOP
|
|
||||||
static int do_quit = 0;
|
static int do_quit = 0;
|
||||||
#endif
|
|
||||||
static Ecore_Fd_Handler *fd_handlers = NULL;
|
static Ecore_Fd_Handler *fd_handlers = NULL;
|
||||||
static Ecore_Fd_Handler *fd_handler_current = NULL;
|
static Ecore_Fd_Handler *fd_handler_current = NULL;
|
||||||
static Eina_List *fd_handlers_with_prep = NULL;
|
static Eina_List *fd_handlers_with_prep = NULL;
|
||||||
|
@ -889,8 +887,13 @@ ecore_main_loop_begin(void)
|
||||||
in_main_loop--;
|
in_main_loop--;
|
||||||
_ecore_unlock();
|
_ecore_unlock();
|
||||||
#else
|
#else
|
||||||
ecore_main_loop = g_main_loop_new(NULL, FALSE);
|
if (!do_quit)
|
||||||
g_main_loop_run(ecore_main_loop);
|
{
|
||||||
|
if (!ecore_main_loop)
|
||||||
|
ecore_main_loop = g_main_loop_new(NULL, FALSE);
|
||||||
|
g_main_loop_run(ecore_main_loop);
|
||||||
|
}
|
||||||
|
do_quit = 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -904,10 +907,10 @@ ecore_main_loop_begin(void)
|
||||||
EAPI void
|
EAPI void
|
||||||
ecore_main_loop_quit(void)
|
ecore_main_loop_quit(void)
|
||||||
{
|
{
|
||||||
#ifndef USE_G_MAIN_LOOP
|
|
||||||
do_quit = 1;
|
do_quit = 1;
|
||||||
#else
|
#ifdef USE_G_MAIN_LOOP
|
||||||
g_main_loop_quit(ecore_main_loop);
|
if (ecore_main_loop)
|
||||||
|
g_main_loop_quit(ecore_main_loop);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue