[gtk+] wayland: Dispatch pending events before entering poll



commit a4d9e92f660618dedf5fdeb51a86f3113c1a4d8b
Author: Rob Bradford <rob linux intel com>
Date:   Sun Aug 4 14:36:01 2013 +0100

    wayland: Dispatch pending events before entering poll
    
    If we don't dispatch the pending events then we can enter poll with events
    still requiring to be processed and which can then lead to us deadlocking
    there.

 gdk/wayland/gdkeventsource.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gdk/wayland/gdkeventsource.c b/gdk/wayland/gdkeventsource.c
index 619ee87..9dda53a 100644
--- a/gdk/wayland/gdkeventsource.c
+++ b/gdk/wayland/gdkeventsource.c
@@ -50,6 +50,9 @@ gdk_event_source_prepare(GSource *base, gint *timeout)
     return TRUE;
 
   if (wl_display_flush (display->wl_display) < 0)
+    g_error ("Error flushing display: %s", g_strerror (errno));
+
+  if (wl_display_dispatch_pending (display->wl_display) < 0)
     g_error ("Error dispatching display: %s", g_strerror (errno));
 
   return FALSE;


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