summaryrefslogtreecommitdiff
path: root/legacy/ecore/src/lib/ecore/ecore_main.c
diff options
context:
space:
mode:
authorMike McCormack <mj.mccormack@samsung.com>2011-07-05 11:13:39 +0000
committerMike McCormack <mikem@ring3k.org>2011-07-05 11:13:39 +0000
commit2e00abb45fd1e2d71baa7ff6f3ee0eb711717230 (patch)
tree1a288c7949b2eccdf0f142ec393ef38640c9a034 /legacy/ecore/src/lib/ecore/ecore_main.c
parent7b1d7bd4a01e7d63d20e4fc3331a939c58af7135 (diff)
ecore: Only dispatch if we have something to do
Signed-off-by: Mike McCormack <mj.mccormack@samsung.com> SVN revision: 61042
Diffstat (limited to '')
-rw-r--r--legacy/ecore/src/lib/ecore/ecore_main.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/legacy/ecore/src/lib/ecore/ecore_main.c b/legacy/ecore/src/lib/ecore/ecore_main.c
index e739398663..ff67821b6f 100644
--- a/legacy/ecore/src/lib/ecore/ecore_main.c
+++ b/legacy/ecore/src/lib/ecore/ecore_main.c
@@ -485,8 +485,23 @@ _ecore_main_gsource_prepare(GSource *source __UNUSED__, gint *next_time)
485static gboolean 485static gboolean
486_ecore_main_gsource_check(GSource *source __UNUSED__) 486_ecore_main_gsource_check(GSource *source __UNUSED__)
487{ 487{
488 gboolean ret = FALSE;
489
488 in_main_loop++; 490 in_main_loop++;
489 491
492 /* check if old timers expired */
493 if (ecore_idling && !_ecore_idler_exist())
494 {
495 if (_ecore_timers_exists())
496 {
497 double next_time = _ecore_timer_next_get();
498 ret = _ecore_timers_exists() && (0.0 >= next_time);
499 }
500 }
501 else
502 ret = TRUE;
503
504 /* check if fds are ready */
490 ecore_fds_ready = (_ecore_main_fdh_poll_mark_active() > 0); 505 ecore_fds_ready = (_ecore_main_fdh_poll_mark_active() > 0);
491 _ecore_main_fd_handlers_cleanup(); 506 _ecore_main_fd_handlers_cleanup();
492 507
@@ -495,7 +510,7 @@ _ecore_main_gsource_check(GSource *source __UNUSED__)
495 510
496 in_main_loop--; 511 in_main_loop--;
497 512
498 return TRUE; /* always dispatch */ 513 return ret || ecore_fds_ready;
499} 514}
500 515
501/* like we just came out of main_loop_select in _ecore_main_select */ 516/* like we just came out of main_loop_select in _ecore_main_select */