diff --git a/src/lib/ecore/Ecore_Common.h b/src/lib/ecore/Ecore_Common.h index 39feead947..2fad5c1988 100644 --- a/src/lib/ecore/Ecore_Common.h +++ b/src/lib/ecore/Ecore_Common.h @@ -73,6 +73,7 @@ EAPI void ecore_main_loop_glib_always_integrate_disable(void); EAPI void ecore_main_loop_begin(void); EAPI void ecore_main_loop_quit(void); +EAPI Eina_Bool ecore_main_loop_animator_ticked_get(void); /** * @typedef Ecore_Cb Ecore_Cb diff --git a/src/lib/ecore/ecore_anim.c b/src/lib/ecore/ecore_anim.c index dd76dafcbf..2bdd8d1b83 100644 --- a/src/lib/ecore/ecore_anim.c +++ b/src/lib/ecore/ecore_anim.c @@ -53,6 +53,7 @@ static Ecore_Cb begin_tick_cb = NULL; static const void *begin_tick_data = NULL; static Ecore_Cb end_tick_cb = NULL; static const void *end_tick_data = NULL; +static Eina_Bool animator_ran = EINA_FALSE; static void _begin_tick(void) @@ -114,6 +115,7 @@ _do_tick(void) (!animator->suspended) && (!animator->just_added)) { + animator_ran = EINA_TRUE; if (!_ecore_call_task_cb(animator->func, animator->data)) { animator->delete_me = EINA_TRUE; @@ -657,6 +659,18 @@ _ecore_animator_shutdown(void) } } +void +_ecore_animator_run_reset(void) +{ + animator_ran = EINA_FALSE; +} + +Eina_Bool +_ecore_animator_run_get(void) +{ + return animator_ran; +} + static Eina_Bool _ecore_animator_run(void *data) { diff --git a/src/lib/ecore/ecore_main.c b/src/lib/ecore/ecore_main.c index 045ccb10a2..44fb957f51 100644 --- a/src/lib/ecore/ecore_main.c +++ b/src/lib/ecore/ecore_main.c @@ -707,6 +707,7 @@ _ecore_main_gsource_dispatch(GSource *source EINA_UNUSED, if (ecore_idling && events_ready) { + _ecore_animator_run_reset(); _ecore_idle_exiter_call(); ecore_idling = 0; } @@ -723,6 +724,7 @@ _ecore_main_gsource_dispatch(GSource *source EINA_UNUSED, if (ecore_fds_ready || events_ready || timers_ready) { + _ecore_animator_run_reset(); _ecore_idle_exiter_call(); ecore_idling = 0; } @@ -1066,6 +1068,21 @@ ecore_main_loop_quit(void) #endif } +/** + * Returns if an animator has ticked off during this loop iteration + * + * @return EINA_TRUE if an animator has been called, EINA_FALSE otherwise. + * + * There should be little need for anyone to use this - ever. + * + * @since 1.9 + */ +EAPI Eina_Bool +ecore_main_loop_animator_ticked_get(void) +{ + return _ecore_animator_run_get(); +} + /** * Sets the function to use when monitoring multiple file descriptors, * and waiting until one of more of the file descriptors before ready @@ -2002,7 +2019,11 @@ start_loop: /***************************************************************/ process_all: /***********************************************************/ /* we came out of our "wait state" so idle has exited */ - if (!once_only) _ecore_idle_exiter_call(); + if (!once_only) + { + _ecore_animator_run_reset(); + _ecore_idle_exiter_call(); + } /* call the fd handler per fd that became alive... */ /* this should read or write any data to the monitored fd and then */ /* post events onto the ecore event pipe if necessary */ diff --git a/src/lib/ecore/ecore_private.h b/src/lib/ecore/ecore_private.h index 1c7f53e5a4..f6a2d5553a 100644 --- a/src/lib/ecore/ecore_private.h +++ b/src/lib/ecore/ecore_private.h @@ -219,6 +219,8 @@ void _ecore_exe_event_del_free(void *data, #endif void _ecore_animator_shutdown(void); +void _ecore_animator_run_reset(void); +Eina_Bool _ecore_animator_run_get(void); void _ecore_poller_shutdown(void);