zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=8c6b26af015ac12da60c7fc52b68a2e0401b4ea3
commit 8c6b26af015ac12da60c7fc52b68a2e0401b4ea3 Author: Mike Blumenkrantz <zm...@samsung.com> Date: Mon Oct 14 09:30:03 2019 -0400 ecore: inhibit "idle" event emission if no subscribers exist Summary: it seems like this was intended to be handled already, but somehow it wasn't... ref T8321 Depends on D10358 Reviewers: cedric Reviewed By: cedric Subscribers: bu5hm4n, cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8321 Differential Revision: https://phab.enlightenment.org/D10359 --- src/lib/ecore/ecore_main.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/lib/ecore/ecore_main.c b/src/lib/ecore/ecore_main.c index e898b6e0f3..cdd51209a0 100644 --- a/src/lib/ecore/ecore_main.c +++ b/src/lib/ecore/ecore_main.c @@ -528,9 +528,10 @@ _ecore_main_idlers_exist(Efl_Loop_Data *pd) } static void -_ecore_main_idler_all_call(Eo *loop) +_ecore_main_idler_all_call(Eo *loop, Efl_Loop_Data *pd) { - efl_event_callback_call(loop, EFL_LOOP_EVENT_IDLE, NULL); + if (pd->idlers) + efl_event_callback_call(loop, EFL_LOOP_EVENT_IDLE, NULL); // just spin in an idler until the free queue is empty freeing 84 items // from the free queue each time.for now this seems like an ok balance // between going in and out of a reduce func with mutexes around it @@ -803,7 +804,7 @@ _ecore_main_gsource_dispatch(GSource *source EINA_UNUSED, if (ecore_idling) { - _ecore_main_idler_all_call(obj); + _ecore_main_idler_all_call(obj, pd); events_ready = pd->message_queue ? 1 : 0; @@ -2236,7 +2237,7 @@ _ecore_main_loop_uv_prepare(uv_prepare_t *handle EINA_UNUSED) if (_ecore_main_uv_idling) { - _ecore_main_idler_all_call(obj); + _ecore_main_idler_all_call(obj, pd); DBG("called idles"); if (_ecore_main_idlers_exist(pd) || (pd->message_queue)) t = 0.0; } @@ -2300,7 +2301,7 @@ _ecore_main_loop_spin_core(Eo *obj, Efl_Loop_Data *pd) // as we are spinning we need to update loop time per spin _update_loop_time(pd); // call all idlers - _ecore_main_idler_all_call(obj); + _ecore_main_idler_all_call(obj, pd); // which returns false if no more idelrs exist if (!_ecore_main_idlers_exist(pd)) return SPIN_RESTART; // sneaky - drop through or if checks - the first one to succeed --