summaryrefslogtreecommitdiff
path: root/src/drivers/Posix
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-02-07 12:47:42 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-02-07 12:47:42 +0100
commit7a8771d3c46bef65e8432554bba8387188c99f3c (patch)
tree951283ef840712259f9602c7624e7646748dffdd /src/drivers/Posix
parent18597e4f6cf88911c292bff6882a0f382517fcfc (diff)
macOS+XQuartz: support new homebrew name for GTK2 shared lib
Diffstat (limited to 'src/drivers/Posix')
-rw-r--r--src/drivers/Posix/Fl_Posix_System_Driver.cxx12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/drivers/Posix/Fl_Posix_System_Driver.cxx b/src/drivers/Posix/Fl_Posix_System_Driver.cxx
index 6d5231365..c4f2dc63c 100644
--- a/src/drivers/Posix/Fl_Posix_System_Driver.cxx
+++ b/src/drivers/Posix/Fl_Posix_System_Driver.cxx
@@ -230,6 +230,10 @@ void *Fl_Posix_System_Driver::dlopen_or_dlsym(const char *lib_name, const char *
if (!lib_address) {
snprintf(path, FL_PATH_MAX, "/sw/lib/%s.dylib", lib_name);
lib_address = dlopen(path, RTLD_LAZY | RTLD_GLOBAL);
+ // the GTK2 shared lib has a new name under homebrew in macOS, try it:
+ if (!lib_address && !strcmp(lib_name, "libgtk-x11-2.0")) {
+ lib_address = dlopen("/opt/homebrew/lib/libgtkmacintegration-gtk2.dylib", RTLD_LAZY | RTLD_GLOBAL);
+ }
}
}
}
@@ -262,13 +266,7 @@ bool Fl_Posix_System_Driver::probe_for_GTK(int major, int minor, void **p_ptr_gt
#endif
} else {
// Try then with GTK2
- Fl_Posix_System_Driver::ptr_gtk = Fl_Posix_System_Driver::dlopen_or_dlsym(
-#ifdef __APPLE__
- "libgtkmacintegration-gtk2"
-#else
- "libgtk-x11-2.0"
-#endif
- );
+ Fl_Posix_System_Driver::ptr_gtk = Fl_Posix_System_Driver::dlopen_or_dlsym("libgtk-x11-2.0");
#ifdef DEBUG
if (Fl_Posix_System_Driver::ptr_gtk) {
puts("selected GTK-2\n");