summaryrefslogtreecommitdiff
path: root/cogl/cogl-poll.c
diff options
context:
space:
mode:
Diffstat (limited to 'cogl/cogl-poll.c')
-rw-r--r--cogl/cogl-poll.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/cogl/cogl-poll.c b/cogl/cogl-poll.c
index 86be2cf0..c6d19fbf 100644
--- a/cogl/cogl-poll.c
+++ b/cogl/cogl-poll.c
@@ -44,6 +44,13 @@ 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)
@@ -70,6 +77,9 @@ cogl_poll_dispatch (CoglContext *context,
_COGL_RETURN_IF_FAIL (cogl_is_context (context));
+ if (!COGL_TAILQ_EMPTY (&context->onscreen_events_queue))
+ _cogl_dispatch_onscreen_events (context);
+
winsys = _cogl_context_get_winsys (context);
if (winsys->poll_dispatch)