Skip to content

Commit 8bccf06

Browse files
committed
EranMes: Adding yet another location where we can find libX11.so.6. Adding future locations should be easier, though.
r14544
1 parent 3f1e9e5 commit 8bccf06

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

cpp/linux-specific/x_ignore_nofocus.c

+10-5
Original file line numberDiff line numberDiff line change
@@ -517,14 +517,19 @@ void* get_xlib_handle()
517517
// If we're not emulating a 32 bit mode (which is either native 32 bit
518518
// or native 64 bit) - use the ordinary path for libX11
519519
if (is_emulated_32bit() == FALSE) {
520-
const char default_x11_location[] = "/usr/lib/libX11.so.6";
521520
// Usually, libX11 will reside in /usr/lib. On some 64-bit Linux
522521
// distributions, it will reside in /usr/lib64.
523-
if (access(default_x11_location, F_OK) == 0) {
524-
snprintf(library, MAX_LIBRARY_PATH, default_x11_location);
525-
} else {
526-
snprintf(library, MAX_LIBRARY_PATH, "/usr/lib64/libX11.so.6");
522+
const char default_x11_location[] = "/usr/lib/libX11.so.6";
523+
const char debian_x11_location[] = "/usr/lib/x86_64-linux-gnu/libX11.so.6";
524+
const char opensuse_x11_location[] = "/usr/lib64/libX11.so.6";
525+
const char *possible_locations[] = {
526+
default_x11_location, debian_x11_location, opensuse_x11_location};
527+
int locations_len = sizeof(possible_locations) / sizeof(char*);
528+
int i = 0;
529+
while (i < (locations_len - 1) && access(possible_locations[i], F_OK) != 0) {
530+
i++;
527531
}
532+
snprintf(library, MAX_LIBRARY_PATH, possible_locations[i]);
528533
} else {
529534
// Use a path that usually contains the 32 bit libs in a 64 bit system.
530535
snprintf(library, MAX_LIBRARY_PATH, "/usr/lib32/libX11.so.6");

cpp/prebuilt/amd64/libnoblur64.so

-1.86 KB
Binary file not shown.

cpp/prebuilt/i386/libnoblur.so

461 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)