diff --git a/src/lib/ecore/ecore_main.c b/src/lib/ecore/ecore_main.c index e8c1d45a1d..a35a2c7b21 100644 --- a/src/lib/ecore/ecore_main.c +++ b/src/lib/ecore/ecore_main.c @@ -273,6 +273,7 @@ static int _ecore_main_win32_select(int nfds, static void _ecore_main_win32_handlers_cleanup(void); #endif +static unsigned char _ecore_exit_code = 0; static int in_main_loop = 0; static int do_quit = 0; static Ecore_Fd_Handler *fd_handlers = NULL; @@ -2733,16 +2734,18 @@ EOLIAN static int _efl_loop_iterate_may_block(Eo *obj EINA_UNUSED, Efl_Loop_Data return ecore_main_loop_iterate_may_block(may_block); } -EOLIAN static void +EOLIAN static unsigned char _efl_loop_begin(Eo *obj EINA_UNUSED, Efl_Loop_Data *pd EINA_UNUSED) { ecore_main_loop_begin(); + return _ecore_exit_code; } EOLIAN static void -_efl_loop_quit(Eo *obj EINA_UNUSED, Efl_Loop_Data *pd EINA_UNUSED) +_efl_loop_quit(Eo *obj EINA_UNUSED, Efl_Loop_Data *pd EINA_UNUSED, unsigned char exit_code) { ecore_main_loop_quit(); + _ecore_exit_code = exit_code; } EOLIAN static Eo_Base * diff --git a/src/lib/ecore/efl_loop.eo b/src/lib/ecore/efl_loop.eo index 77af2885fb..0d00ee7971 100644 --- a/src/lib/ecore/efl_loop.eo +++ b/src/lib/ecore/efl_loop.eo @@ -29,10 +29,14 @@ class Efl.Loop (Eo.Base) } begin { [[Runs the application main loop.]] + return: ubyte; [[Value set by quit()]] } quit { [[Quits the main loop once all the events currently on the queue have been processed.]] + params { + @in exit_code: ubyte; [[Returned value by begin()]] + } } job { [[Will execute that promise in the near future.]]