diff --git a/src/java/org/lwjgl/opengl/LinuxDisplay.java b/src/java/org/lwjgl/opengl/LinuxDisplay.java index 30728fa3e..4de2a1a8e 100644 --- a/src/java/org/lwjgl/opengl/LinuxDisplay.java +++ b/src/java/org/lwjgl/opengl/LinuxDisplay.java @@ -43,6 +43,7 @@ import java.awt.event.FocusEvent; import java.io.BufferedReader; +import java.io.File; import java.io.IOException; import java.io.InputStreamReader; import java.nio.ByteOrder; @@ -210,9 +211,25 @@ private static int getBestDisplayModeExtension() { return result; } + private static String findXrandr() { + for (String path : System.getenv("PATH").split(File.pathSeparator)) { + File file = new File(path, "xrandr"); + if (file.isFile() && file.canExecute()) { + return file.getAbsolutePath(); + } + } + + return null; + } + private static boolean isXrandrSupported() { if (Display.getPrivilegedBoolean("LWJGL_DISABLE_XRANDR")) return false; + + if (findXrandr() == null) { + return false; + } + lockAWT(); try { incDisplay(); diff --git a/src/java/org/lwjgl/opengl/XRandR.java b/src/java/org/lwjgl/opengl/XRandR.java index 8e59bb64a..ba9976ff9 100644 --- a/src/java/org/lwjgl/opengl/XRandR.java +++ b/src/java/org/lwjgl/opengl/XRandR.java @@ -146,6 +146,7 @@ private static void populate() { LWJGLUtil.log("Exception in XRandR.populate(): " + e.getMessage()); screens.clear(); current = new Screen[0]; + throw new RuntimeException(e); } }