Branch: refs/heads/master Author: Jiří Techet techet@gmail.com Committer: elextr elextr@gmail.com Date: Sat, 07 Oct 2017 00:48:47 UTC Commit: 3fb94c235c91a980a7fd7aa159f373b457833148 https://github.com/geany/geany/commit/3fb94c235c91a980a7fd7aa159f373b4578331...
Log Message: ----------- Use non-symlinked VTE libraries on macOS (#1625)
* Try non-symlinked VTE libraries on macOS before the symlinked ones
Plugins using VTE such as multiterm or debugger are linked against the non-symlinked version of the library like libvte.9.dylib and not libvte.dylib. When a bundle is created, all symlinks are replaced by a copy of the symlinked file. This means there are both libvte.dylib and libvte.9.dylib in the bundle both containing the same code. When Geany loads libvte.dylib and plugins load libvte.9.dylib the same code gets loaded twice and when the same type gets registered by GTK, it fails and the whole application freezes.
This problem doesn't exist on linux or when running from the command line on macOS because the operating system detects it's the same library because of the symlink and it's loaded only once.
Loading the same library as the one used by plugins fixes the issue with macOS bundle. The original symlinked name is still used as a fallback.
The patch also adds #ifdef __APPLE__ around the Apple-specific library names which also prevents unnecessary retries on other platforms. Loading *.so libraries is still kept as a fallback on Apple as these are legal too and could in theory be used on OS X as well.
* Try loading newer VTE versions before older ones on GTK 2
Modified Paths: -------------- src/vte.c
Modified: src/vte.c 15 lines changed, 11 insertions(+), 4 deletions(-) =================================================================== @@ -276,10 +276,17 @@ void vte_init(void) gint i; const gchar *sonames[] = { #if GTK_CHECK_VERSION(3, 0, 0) - "libvte-2.91.so", "libvte-2.91.so.0", "libvte-2.91.dylib", - "libvte2_90.so", "libvte2_90.so.9", "libvte2_90.dylib", -#else - "libvte.so", "libvte.so.4", "libvte.so.8", "libvte.so.9", "libvte.dylib", +# ifdef __APPLE__ + "libvte-2.91.0.dylib", "libvte-2.91.dylib", + "libvte2_90.9.dylib", "libvte2_90.dylib", +# endif + "libvte-2.91.so", "libvte-2.91.so.0", + "libvte2_90.so", "libvte2_90.so.9", +#else /* GTK 2 */ +# ifdef __APPLE__ + "libvte.9.dylib", "libvte.dylib", +# endif + "libvte.so", "libvte.so.9", "libvte.so.8", "libvte.so.4", #endif NULL };
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).