[gtk+] wayland: don't attempt to unqueue events when events are paused

commit 00a107cc4c16ed95142468735969fa82b2b8588f
Author: Thomas Wood <thomas wood intel com>
Date:   Wed Feb 20 13:53:59 2013 +0000

    wayland: don't attempt to unqueue events when events are paused
    When events are paused, we should not return TRUE from prepare() or check().
    GTK+ handles this for events that are already in the GTK+ queue, but
    we also need suppress checks for events that are in the system queue - if we
    return TRUE indicating that there are events in the system queue, then we'll
    call dispatch(), and do nothing. The event source will spin, and will never
    run the other phases of the paint clock.

 gdk/wayland/gdkeventsource.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/gdk/wayland/gdkeventsource.c b/gdk/wayland/gdkeventsource.c
index 1eff3fb..93f68dc 100644
--- a/gdk/wayland/gdkeventsource.c
+++ b/gdk/wayland/gdkeventsource.c
@@ -37,6 +37,9 @@ gdk_event_source_prepare(GSource *base, gint *timeout)
   *timeout = -1;
+  if (source->display->event_pause_count > 0)
+    return FALSE;
   /* We have to add/remove the GPollFD if we want to update our
    * poll event mask dynamically.  Instead, let's just flush all
    * write on idle instead, which is what this amounts to. */
@@ -57,6 +60,9 @@ gdk_event_source_check(GSource *base)
   if (source->pfd.revents & (G_IO_ERR | G_IO_HUP))
     g_error ("Lost connection to wayland compositor");
+  if (source->display->event_pause_count > 0)
+    return FALSE;
   return _gdk_event_queue_find_first (source->display) != NULL ||

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