[gtk+/gtk-3-10] broadway: Print a useful error message



commit 402776103a13708b6181e9a25441e1726471eafa
Author: Benjamin Otte <otte redhat com>
Date:   Sun Mar 2 17:59:34 2014 +0100

    broadway: Print a useful error message
    
    .. instead of the generic "failed to open display".

 gdk/broadway/gdkdisplay-broadway.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gdk/broadway/gdkdisplay-broadway.c b/gdk/broadway/gdkdisplay-broadway.c
index 36ce569..853dd4a 100644
--- a/gdk/broadway/gdkdisplay-broadway.c
+++ b/gdk/broadway/gdkdisplay-broadway.c
@@ -123,6 +123,7 @@ _gdk_broadway_display_open (const gchar *display_name)
 {
   GdkDisplay *display;
   GdkBroadwayDisplay *broadway_display;
+  GError *error = NULL;
 
   display = g_object_new (GDK_TYPE_BROADWAY_DISPLAY, NULL);
   broadway_display = GDK_BROADWAY_DISPLAY (display);
@@ -151,10 +152,11 @@ _gdk_broadway_display_open (const gchar *display_name)
   if (display_name == NULL)
     display_name = g_getenv ("BROADWAY_DISPLAY");
 
-  broadway_display->server = _gdk_broadway_server_new (display_name, NULL);
+  broadway_display->server = _gdk_broadway_server_new (display_name, &error);
   if (broadway_display->server == NULL)
     {
-      g_printerr ("Unable to init server\n");
+      g_printerr ("Unable to init server: %s\n", error->message);
+      g_error_free (error);
       return NULL;
     }
 


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