More in the comment.
Fixes https://github.com/geany/geany/issues/1277
Even if the call gets replaced with something non-blocking in GDK, we can't be sure against which version of GTK Geany gets built (e.g. if someone is using Homebrew) so better to handle it in Geany too. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/1399
-- Commit Summary --
* Avoid gdk_display_get_name() on OS X
-- File Changes --
M src/socket.c (7)
-- Patch Links --
https://github.com/geany/geany/pull/1399.patch https://github.com/geany/geany/pull/1399.diff
b4n commented on this pull request.
@@ -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
maybe under Quartz it doesn't matter, but shouldn't this be guarded by `if (GDK_IS_QUARTZ_DISPLAY (display))` to support a build combining X11 and Quartz?
```C #ifdef GDK_WINDOWING_QUARTZ if (display != NULL && GDK_IS_QUARTZ_DISPLAY (display)) ; /* nothing */ else #endif if (display != NULL) ... ``` Or a prettier variation around this.
techee commented on this pull request.
@@ -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
Well, I didn't do this in Scintilla because of problems
https://sourceforge.net/p/scintilla/bugs/1696/
neither in Geany
https://github.com/geany/geany/blob/master/src/editor.c#L4927
before already and I'm not sure if it makes much sense for OS X.
b4n commented on this pull request.
@@ -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
OK nevermind then
b4n approved this pull request.
@b4n Could this be merged before the release? The long start time is rather annoying so I'd like to have this in.
Merged #1399.
github-comments@lists.geany.org