summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/classes/com/sun/opengl/impl/x11/DRIHack.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/classes/com/sun/opengl/impl/x11/DRIHack.java b/src/classes/com/sun/opengl/impl/x11/DRIHack.java
index 181210982..1d3d15955 100644
--- a/src/classes/com/sun/opengl/impl/x11/DRIHack.java
+++ b/src/classes/com/sun/opengl/impl/x11/DRIHack.java
@@ -80,19 +80,24 @@ public class DRIHack {
public static native long dlopen(String name);
public static native int dlclose(long handle);
+ private static final boolean DEBUG = Debug.debug("DRIHack");
private static boolean driHackNeeded;
private static long libGLHandle;
public static void begin() {
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
- driHackNeeded = new File("/usr/lib/dri").exists();
+ driHackNeeded =
+ (new File("/usr/lib/dri").exists() ||
+ new File("/usr/X11R6/lib/modules/dri").exists());
return null;
}
});
if (driHackNeeded) {
- System.err.println("Beginning DRI hack");
+ if (DEBUG) {
+ System.err.println("Beginning DRI hack");
+ }
NativeLibLoader.loadDRIHack();
libGLHandle = dlopen("/usr/lib/libGL.so.1");
@@ -101,7 +106,9 @@ public class DRIHack {
public static void end() {
if (libGLHandle != 0) {
- System.err.println("Ending DRI hack");
+ if (DEBUG) {
+ System.err.println("Ending DRI hack");
+ }
dlclose(libGLHandle);
}