From a55b6bb98ec276907516c4dbff9c87ab905105fa Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Tue, 12 Jul 2011 11:57:03 +0000 Subject: [PATCH] ecore: Make g_main_loop call idle enterers last Signed-off-by: Mike McCormack SVN revision: 61285 --- legacy/ecore/src/bin/ecore_test.c | 4 ++-- legacy/ecore/src/lib/ecore/ecore_main.c | 13 +++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/legacy/ecore/src/bin/ecore_test.c b/legacy/ecore/src/bin/ecore_test.c index 88c9ddca2c..45a9b24cf6 100644 --- a/legacy/ecore/src/bin/ecore_test.c +++ b/legacy/ecore/src/bin/ecore_test.c @@ -104,8 +104,8 @@ int main(int argc __UNUSED__, char **argv __UNUSED__) ecore_main_loop_begin(); - /* FIXME?: glib main loop exits on an idle enterer */ - //assert(called == idle_enterer_str); + /* glib main loop exits on an idle enterer */ + assert(called == idle_enterer_str); ecore_shutdown(); return 0; diff --git a/legacy/ecore/src/lib/ecore/ecore_main.c b/legacy/ecore/src/lib/ecore/ecore_main.c index 5cf9f7d2d4..2f108e5383 100644 --- a/legacy/ecore/src/lib/ecore/ecore_main.c +++ b/legacy/ecore/src/lib/ecore/ecore_main.c @@ -237,6 +237,7 @@ static GSource *ecore_glib_source; static guint ecore_glib_source_id; static GMainLoop* ecore_main_loop; static gboolean ecore_idling; +static gboolean _ecore_glib_idle_enterer_called; static gboolean ecore_fds_ready; #endif @@ -489,11 +490,11 @@ _ecore_main_gsource_prepare(GSource *source __UNUSED__, gint *next_time) in_main_loop++; - if (!ecore_idling) + if (!ecore_idling && !_ecore_glib_idle_enterer_called) { - /* when idling, busy loop checking the fds only */ - _ecore_idle_enterer_call(); - _ecore_throttle(); + _ecore_idle_enterer_call(); + _ecore_throttle(); + _ecore_glib_idle_enterer_called = FALSE; } while (_ecore_signal_count_get()) _ecore_signal_call(); @@ -668,6 +669,10 @@ _ecore_main_gsource_dispatch(GSource *source __UNUSED__, GSourceFunc callback __ while (_ecore_timer_call(_ecore_time_loop_time)); _ecore_timer_cleanup(); + + _ecore_idle_enterer_call(); + _ecore_throttle(); + _ecore_glib_idle_enterer_called = TRUE; } in_main_loop--;