[gtk+] wayland: Don't abort when preparing the source if connection is lost



commit 28f8a27d652127b600a6ae1baee3bad5770bfa20
Author: Debarshi Ray <debarshir gnome org>
Date:   Wed May 24 16:08:07 2017 +0200

    wayland: Don't abort when preparing the source if connection is lost
    
    Aborting the application makes it look like an application bug, when
    it is the expected thing to do when the Wayland display server goes
    way. eg., when the user logs out. The log level is also demoted to
    avoid a storm of warnings in the log from all applications whenever
    this happens.
    
    This is also what the X11 backend does (see gdk_x_io_error).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=783047

 gdk/wayland/gdkeventsource.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gdk/wayland/gdkeventsource.c b/gdk/wayland/gdkeventsource.c
index 1420917..bdb4c80 100644
--- a/gdk/wayland/gdkeventsource.c
+++ b/gdk/wayland/gdkeventsource.c
@@ -63,7 +63,10 @@ gdk_event_source_prepare (GSource *base,
   source->reading = TRUE;
 
   if (wl_display_flush (display->wl_display) < 0)
-    g_error ("Error flushing display: %s", g_strerror (errno));
+    {
+      g_message ("Error flushing display: %s", g_strerror (errno));
+      _exit (1);
+    }
 
   return FALSE;
 }


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