[cogl/cogl-1.14] poll: Always let the winsys add fds even if there is a zero timeout



commit 8122368c6aef17408aa4206896bbbe71d604e509
Author: Neil Roberts <neil linux intel com>
Date:   Sun Feb 3 10:03:39 2013 +0100

    poll: Always let the winsys add fds even if there is a zero timeout
    
    Even if Cogl decides to set a zero timeout because there are events
    queued, it still makes sense to give the winsys a chance to add file
    descriptors to the list. The winsys might be relying on the list of
    CoglPollFDs passed to poll_dispatch to decide whether to read from a
    file descriptor and that should happen even if Cogl also woke up the
    main loop because the event queue isn't empty.
    
    Reviewed-by: Robert Bragg <robert linux intel com>
    
    (cherry picked from commit 6d2f3bc4913d0f1570c09e3714ac8fe2dbfc7a03)

 cogl/cogl-poll.c |   21 +++++++++------------
 1 files changed, 9 insertions(+), 12 deletions(-)
---
diff --git a/cogl/cogl-poll.c b/cogl/cogl-poll.c
index c6d19fb..277b9a7 100644
--- a/cogl/cogl-poll.c
+++ b/cogl/cogl-poll.c
@@ -44,13 +44,6 @@ cogl_poll_get_info (CoglContext *context,
   _COGL_RETURN_IF_FAIL (n_poll_fds != NULL);
   _COGL_RETURN_IF_FAIL (timeout != NULL);
 
-  if (!COGL_TAILQ_EMPTY (&context->onscreen_events_queue))
-    {
-      *n_poll_fds = 0;
-      *timeout = 0;
-      return;
-    }
-
   winsys = _cogl_context_get_winsys (context);
 
   if (winsys->poll_get_info)
@@ -59,13 +52,17 @@ cogl_poll_get_info (CoglContext *context,
                              poll_fds,
                              n_poll_fds,
                              timeout);
-      return;
+    }
+  else
+    {
+      /* By default we'll assume Cogl doesn't need to block on anything */
+      *poll_fds = NULL;
+      *n_poll_fds = 0;
+      *timeout = -1; /* no timeout */
     }
 
-  /* By default we'll assume Cogl doesn't need to block on anything */
-  *poll_fds = NULL;
-  *n_poll_fds = 0;
-  *timeout = -1; /* no timeout */
+  if (!COGL_TAILQ_EMPTY (&context->onscreen_events_queue))
+    *timeout = 0;
 }
 
 void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]