forked from AuroraMiddleware/gtk
broadway: Print a useful error message
.. instead of the generic "failed to open display".
This commit is contained in:
parent
936675aa01
commit
32a420b7d6
@ -123,6 +123,7 @@ _gdk_broadway_display_open (const gchar *display_name)
|
|||||||
{
|
{
|
||||||
GdkDisplay *display;
|
GdkDisplay *display;
|
||||||
GdkBroadwayDisplay *broadway_display;
|
GdkBroadwayDisplay *broadway_display;
|
||||||
|
GError *error = NULL;
|
||||||
|
|
||||||
display = g_object_new (GDK_TYPE_BROADWAY_DISPLAY, NULL);
|
display = g_object_new (GDK_TYPE_BROADWAY_DISPLAY, NULL);
|
||||||
broadway_display = GDK_BROADWAY_DISPLAY (display);
|
broadway_display = GDK_BROADWAY_DISPLAY (display);
|
||||||
@ -151,10 +152,11 @@ _gdk_broadway_display_open (const gchar *display_name)
|
|||||||
if (display_name == NULL)
|
if (display_name == NULL)
|
||||||
display_name = g_getenv ("BROADWAY_DISPLAY");
|
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)
|
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;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user