summaryrefslogtreecommitdiff
path: root/src/drivers/X11
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/X11')
-rw-r--r--src/drivers/X11/Fl_X11_Screen_Driver.cxx6
-rw-r--r--src/drivers/X11/Fl_X11_System_Driver.cxx15
2 files changed, 4 insertions, 17 deletions
diff --git a/src/drivers/X11/Fl_X11_Screen_Driver.cxx b/src/drivers/X11/Fl_X11_Screen_Driver.cxx
index d13562ea9..ff095f2c4 100644
--- a/src/drivers/X11/Fl_X11_Screen_Driver.cxx
+++ b/src/drivers/X11/Fl_X11_Screen_Driver.cxx
@@ -21,6 +21,7 @@
#include "Fl_X11_Screen_Driver.H"
#include "../Xlib/Fl_Font.H"
#include "Fl_X11_Window_Driver.H"
+#include "../../src/Fl_System_Driver.H"
#include "../Xlib/Fl_Xlib_Graphics_Driver.H"
#include <FL/Fl.H>
#include <FL/platform.H>
@@ -287,10 +288,7 @@ void Fl_X11_Screen_Driver::init() {
static XRRSizes_type XRRSizes_f = NULL;
if (!XRRSizes_f) {
void *libxrandr_addr = dlopen("libXrandr.so.2", RTLD_LAZY);
- if (!libxrandr_addr) libxrandr_addr = dlopen("libXrandr.so", RTLD_LAZY);
-# ifdef __APPLE_CC__ // allows testing on Darwin + X11
- if (!libxrandr_addr) libxrandr_addr = dlopen("/opt/X11/lib/libXrandr.dylib", RTLD_LAZY);
-# endif
+ if (!libxrandr_addr) libxrandr_addr = Fl::system_driver()->dlopen("libXrandr.so");
if (libxrandr_addr) XRRSizes_f = (XRRSizes_type)dlsym(libxrandr_addr, "XRRSizes");
}
if (XRRSizes_f) {
diff --git a/src/drivers/X11/Fl_X11_System_Driver.cxx b/src/drivers/X11/Fl_X11_System_Driver.cxx
index f406dce02..412d64667 100644
--- a/src/drivers/X11/Fl_X11_System_Driver.cxx
+++ b/src/drivers/X11/Fl_X11_System_Driver.cxx
@@ -520,13 +520,6 @@ int Fl_X11_System_Driver::utf8locale() {
#if HAVE_DLSYM && HAVE_DLFCN_H
#include <dlfcn.h> // for dlopen et al
-static void* fl_dlopen(const char *filename1, const char *filename2)
-{
- void *ptr = dlopen(filename1, RTLD_LAZY | RTLD_GLOBAL);
- if (!ptr) ptr = dlopen(filename2, RTLD_LAZY | RTLD_GLOBAL);
- return ptr;
-}
-
bool Fl_X11_System_Driver::probe_for_GTK(int major, int minor, void **ptr_gtk) {
typedef void (*init_t)(int*, void*);
*ptr_gtk = NULL;
@@ -536,18 +529,14 @@ bool Fl_X11_System_Driver::probe_for_GTK(int major, int minor, void **ptr_gtk) {
*ptr_gtk = RTLD_DEFAULT; // Caution: NULL under linux, not-NULL under Darwin
} else {
// Try first with GTK3
- *ptr_gtk = fl_dlopen("libgtk-3.so", "libgtk-3.so.0");
+ *ptr_gtk = Fl::system_driver()->dlopen("libgtk3.0.so");
if (*ptr_gtk) {
#ifdef DEBUG
puts("selected GTK-3\n");
#endif
} else {
// Try then with GTK2
-# ifdef __APPLE_CC__ // allows testing on Darwin + X11
- *ptr_gtk = ::dlopen("/sw/lib/libgtk-x11-2.0.dylib", RTLD_LAZY | RTLD_GLOBAL);
-#else
- *ptr_gtk = fl_dlopen("libgtk-x11-2.0.so", "libgtk-x11-2.0.so.0");
-#endif
+ *ptr_gtk = Fl::system_driver()->dlopen("libgtk-x11-2.0.so");
}
if (*ptr_gtk) {
#ifdef DEBUG