[gtk+] broadway: Print a useful error message



commit 32a420b7d61c48e847c654f0fd9f13e38bbb71f3
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 c4f1d31..327d95d 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]