summaryrefslogtreecommitdiff
path: root/src/drivers/X11/Fl_X11_Screen_Driver.cxx
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2020-10-04 08:20:50 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2020-10-04 08:21:07 +0200
commit0c55cd1aca19b57a9b8837d1672ae260cfca4d78 (patch)
treea9f5b10b3ec558d7525f24037cafc86ce796d9e5 /src/drivers/X11/Fl_X11_Screen_Driver.cxx
parent46598229a9605b25e3da5e0d7ad41343cf429497 (diff)
Create Fl_X11_System_Driver::dlopen_or_dlsym() for run-time addresses.
The intent is to gather in a single place of the X11 platform source code all variable elements when using dlopen() and dlsym() system functions (e.g., .so vs .dylib extension name, is RTLD_DEFAULT available, locations to be sought). Member function Fl_System_Driver::load() is created only to support Fl_Plugin_Manager::load().
Diffstat (limited to 'src/drivers/X11/Fl_X11_Screen_Driver.cxx')
-rw-r--r--src/drivers/X11/Fl_X11_Screen_Driver.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/drivers/X11/Fl_X11_Screen_Driver.cxx b/src/drivers/X11/Fl_X11_Screen_Driver.cxx
index a09768975..30482cf8f 100644
--- a/src/drivers/X11/Fl_X11_Screen_Driver.cxx
+++ b/src/drivers/X11/Fl_X11_Screen_Driver.cxx
@@ -1,7 +1,7 @@
//
// Definition of X11 Screen interface
//
-// Copyright 1998-2018 by Bill Spitzak and others.
+// Copyright 1998-2020 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -19,7 +19,8 @@
#include "Fl_X11_Screen_Driver.H"
#include "../Xlib/Fl_Font.H"
#include "Fl_X11_Window_Driver.H"
-#include "../../Fl_System_Driver.H"
+#include "Fl_X11_System_Driver.H"
+#include "../Posix/Fl_Posix_System_Driver.H"
#include "../Xlib/Fl_Xlib_Graphics_Driver.H"
#include <FL/Fl.H>
#include <FL/platform.H>
@@ -285,9 +286,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 = Fl::system_driver()->dlopen("libXrandr.so");
- if (libxrandr_addr) XRRSizes_f = (XRRSizes_type)dlsym(libxrandr_addr, "XRRSizes");
+ XRRSizes_f = (XRRSizes_type)Fl_X11_System_Driver::dlopen_or_dlsym("libXrandr", "XRRSizes");
}
if (XRRSizes_f) {
int nscreens;