summaryrefslogtreecommitdiff
path: root/legacy/ecore/src/lib/ecore/ecore_main.c
diff options
context:
space:
mode:
authorMike McCormack <mj.mccormack@samsung.com>2011-11-29 09:24:51 +0000
committerMike McCormack <mikem@ring3k.org>2011-11-29 09:24:51 +0000
commitf57db57c252a26b31a8f0f447484a77e04353f78 (patch)
treeb7399088f55cb7bb2909977680bc711db0f60627 /legacy/ecore/src/lib/ecore/ecore_main.c
parente08be28ccce883f68ab30a289e018e1288991a35 (diff)
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
Diffstat (limited to '')
-rw-r--r--legacy/ecore/src/lib/ecore/ecore_main.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/legacy/ecore/src/lib/ecore/ecore_main.c b/legacy/ecore/src/lib/ecore/ecore_main.c
index 152836aa7b..aacf991fd7 100644
--- a/legacy/ecore/src/lib/ecore/ecore_main.c
+++ b/legacy/ecore/src/lib/ecore/ecore_main.c
@@ -207,9 +207,7 @@ static void _ecore_main_win32_handlers_cleanup(void);
207#endif 207#endif
208 208
209static int in_main_loop = 0; 209static int in_main_loop = 0;
210#ifndef USE_G_MAIN_LOOP
211static int do_quit = 0; 210static int do_quit = 0;
212#endif
213static Ecore_Fd_Handler *fd_handlers = NULL; 211static Ecore_Fd_Handler *fd_handlers = NULL;
214static Ecore_Fd_Handler *fd_handler_current = NULL; 212static Ecore_Fd_Handler *fd_handler_current = NULL;
215static Eina_List *fd_handlers_with_prep = NULL; 213static Eina_List *fd_handlers_with_prep = NULL;
@@ -889,8 +887,13 @@ ecore_main_loop_begin(void)
889 in_main_loop--; 887 in_main_loop--;
890 _ecore_unlock(); 888 _ecore_unlock();
891#else 889#else
892 ecore_main_loop = g_main_loop_new(NULL, FALSE); 890 if (!do_quit)
893 g_main_loop_run(ecore_main_loop); 891 {
892 if (!ecore_main_loop)
893 ecore_main_loop = g_main_loop_new(NULL, FALSE);
894 g_main_loop_run(ecore_main_loop);
895 }
896 do_quit = 0;
894#endif 897#endif
895} 898}
896 899
@@ -904,10 +907,10 @@ ecore_main_loop_begin(void)
904EAPI void 907EAPI void
905ecore_main_loop_quit(void) 908ecore_main_loop_quit(void)
906{ 909{
907#ifndef USE_G_MAIN_LOOP
908 do_quit = 1; 910 do_quit = 1;
909#else 911#ifdef USE_G_MAIN_LOOP
910 g_main_loop_quit(ecore_main_loop); 912 if (ecore_main_loop)
913 g_main_loop_quit(ecore_main_loop);
911#endif 914#endif
912} 915}
913 916