ecore: Check for pending before entering g_main_loop
authormike_m <mike_m@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 8 Jul 2011 08:07:40 +0000 (08:07 +0000)
committermike_m <mike_m@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 8 Jul 2011 08:07:40 +0000 (08:07 +0000)
Signed-off-by: Mike McCormack <mj.mccormack@samsung.com>
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@61150 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/ecore/ecore_main.c

index 54fb39d..2dc59d8 100644 (file)
@@ -497,12 +497,14 @@ _ecore_main_gsource_prepare(GSource *source __UNUSED__, gint *next_time)
          _ecore_throttle();
      }
 
+   while (_ecore_signal_count_get()) _ecore_signal_call();
+
    /* don't check fds if somebody quit */
    running = g_main_loop_is_running(ecore_main_loop);
    if (running)
      {
         /* only set idling state in dispatch */
-        if (ecore_idling && !_ecore_idler_exist())
+        if (ecore_idling && !_ecore_idler_exist() && !_ecore_event_exist())
           {
              if (_ecore_timers_exists())
                {
@@ -561,7 +563,7 @@ _ecore_main_gsource_check(GSource *source __UNUSED__)
    in_main_loop++;
 
    /* check if old timers expired */
-   if (ecore_idling && !_ecore_idler_exist())
+   if (ecore_idling && !_ecore_idler_exist() && !_ecore_event_exist())
      {
         if (timer_fd >= 0)
           {
@@ -590,10 +592,6 @@ _ecore_main_gsource_check(GSource *source __UNUSED__)
      ecore_fds_ready = (_ecore_main_fdh_glib_mark_active() > 0);
    _ecore_main_fd_handlers_cleanup();
 
-   /* ^C perhaps? */
-   if (!ret && _ecore_signal_count_get() > 0)
-     ret = TRUE;
-
    /* check timers after updating loop time */
    _ecore_time_loop_time = ecore_time_get();
    if (!ret && _ecore_timers_exists())