Avoid gdk_display_get_name() on OS X

More in the comment.
This commit is contained in:
Jiří Techet 2017-02-16 11:45:46 +01:00
parent 170ebf610f
commit ed46b65c00

View File

@ -284,8 +284,15 @@ gint socket_init(gint argc, gchar **argv)
GdkDisplay *display = gdk_display_get_default();
gchar *p;
/* On OS X with quartz backend gdk_display_get_name() returns hostname
* using [NSHost currentHost] (it could return more or less whatever string
* as display name is a X11 specific thing). This call can lead to network
* query and block for several seconds so better skip it. */
#ifndef GDK_WINDOWING_QUARTZ
if (display != NULL)
display_name = g_strdup(gdk_display_get_name(display));
#endif
if (display_name == NULL)
display_name = g_strdup("NODISPLAY");