X11: Try to load libXrandr.so.3 if libXrandr.so.2 isn't found
All Linux distros, and FreeBSD and OpenBSD seem to have libXrandr.so.2,
but for some reason recent NetBSD versions seem to have libXrandr.so.3 now.
(cherry picked from commit 413ff7938d
)
This commit is contained in:
parent
b73a9109ab
commit
8b5061aae7
|
@ -163,7 +163,12 @@ Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
|
||||||
xrandr_handle = dlopen("libXrandr.so.2", RTLD_LAZY);
|
xrandr_handle = dlopen("libXrandr.so.2", RTLD_LAZY);
|
||||||
if (!xrandr_handle) {
|
if (!xrandr_handle) {
|
||||||
err = dlerror();
|
err = dlerror();
|
||||||
fprintf(stderr, "could not load libXrandr.so.2, Error: %s\n", err);
|
// For some arcane reason, NetBSD now ships libXrandr.so.3 while the rest of the world has libXrandr.so.2...
|
||||||
|
// In case this happens for other X11 platforms in the future, let's give it a try too before failing.
|
||||||
|
xrandr_handle = dlopen("libXrandr.so.3", RTLD_LAZY);
|
||||||
|
if (!xrandr_handle) {
|
||||||
|
fprintf(stderr, "could not load libXrandr.so.2, Error: %s\n", err);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
XRRQueryVersion(x11_display, &xrandr_major, &xrandr_minor);
|
XRRQueryVersion(x11_display, &xrandr_major, &xrandr_minor);
|
||||||
if (((xrandr_major << 8) | xrandr_minor) >= 0x0105) {
|
if (((xrandr_major << 8) | xrandr_minor) >= 0x0105) {
|
||||||
|
|
Loading…
Reference in New Issue