dca6ef
From c3503fcc84eec0bcf857cc744580aa9a4d5dc7eb Mon Sep 17 00:00:00 2001
dca6ef
From: Matthias Clasen <mclasen@redhat.com>
dca6ef
Date: Tue, 13 Apr 2021 14:10:27 -0400
dca6ef
Subject: [PATCH] x11: Be quiet on exit by default
dca6ef
dca6ef
The condition we check for to catch X servers going away
dca6ef
may not be accurate anymore, and the warning shows up in
dca6ef
logs, causing customers to be concerned. So, be quiet by
dca6ef
default, unless the user explicitly asked for a message.
dca6ef
---
dca6ef
 gdk/x11/gdkmain-x11.c | 23 ++++++-----------------
dca6ef
 1 file changed, 6 insertions(+), 17 deletions(-)
dca6ef
dca6ef
diff --git a/gdk/x11/gdkmain-x11.c b/gdk/x11/gdkmain-x11.c
dca6ef
index 64c7cb4302..cd877ce3e4 100644
dca6ef
--- a/gdk/x11/gdkmain-x11.c
dca6ef
+++ b/gdk/x11/gdkmain-x11.c
dca6ef
@@ -240,24 +240,13 @@ gdk_x_io_error (Display *display)
dca6ef
   /* This is basically modelled after the code in XLib. We need
dca6ef
    * an explicit error handler here, so we can disable our atexit()
dca6ef
    * which would otherwise cause a nice segfault.
dca6ef
-   * We fprintf(stderr, instead of g_warning() because g_warning()
dca6ef
-   * could possibly be redirected to a dialog
dca6ef
+   * We g_debug() instead of g_warning(), because g_warning()
dca6ef
+   * could possibly be redirected to the log
dca6ef
    */
dca6ef
-  if (errno == EPIPE)
dca6ef
-    {
dca6ef
-      g_message ("The application '%s' lost its connection to the display %s;\n"
dca6ef
-                 "most likely the X server was shut down or you killed/destroyed\n"
dca6ef
-                 "the application.\n",
dca6ef
-                 g_get_prgname (),
dca6ef
-                 display ? DisplayString (display) : gdk_get_display_arg_name ());
dca6ef
-    }
dca6ef
-  else
dca6ef
-    {
dca6ef
-      g_message ("%s: Fatal IO error %d (%s) on X server %s.\n",
dca6ef
-                 g_get_prgname (),
dca6ef
-                 errno, g_strerror (errno),
dca6ef
-                 display ? DisplayString (display) : gdk_get_display_arg_name ());
dca6ef
-    }
dca6ef
+  g_debug ("%s: Fatal IO error %d (%s) on X server %s.\n",
dca6ef
+           g_get_prgname (),
dca6ef
+           errno, g_strerror (errno),
dca6ef
+           display ? DisplayString (display) : gdk_get_display_arg_name ());
dca6ef
 
dca6ef
   _exit (1);
dca6ef
 }
dca6ef
-- 
dca6ef
GitLab
dca6ef