From b5a734ff243225e4f319fa1795d3f1ec77827915 Mon Sep 17 00:00:00 2001 From: onurs <10urshin@users.noreply.github.com> Date: Thu, 22 Nov 2018 23:53:43 +0300 Subject: [PATCH] Support for cvt modeline output https://wiki.archlinux.org/index.php/xrandr#Troubleshooting ctv tool generates display modes as 1280x1024_60.00 instead of 1280x1024 $ cvt 1280 1024 # 1280x1024 59.89 Hz (CVT 1.31M4) hsync: 63.67 kHz; pclk: 109.00 MHz Modeline "1280x1024_60.00" 109.00 1280 1368 1496 1712 1024 1027 1034 1063 -hsync +vsync --- src/java/org/lwjgl/opengl/XRandR.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/java/org/lwjgl/opengl/XRandR.java b/src/java/org/lwjgl/opengl/XRandR.java index 8e59bb64a..2fa81d6fe 100644 --- a/src/java/org/lwjgl/opengl/XRandR.java +++ b/src/java/org/lwjgl/opengl/XRandR.java @@ -262,7 +262,7 @@ public static Screen[] getResolutions(String name) { } private static final Pattern SCREEN_HEADER_PATTERN = Pattern.compile("^(\\d+)x(\\d+)[+](\\d+)[+](\\d+)$"); - private static final Pattern SCREEN_MODELINE_PATTERN = Pattern.compile("^(\\d+)x(\\d+)$"); + private static final Pattern SCREEN_MODELINE_PATTERN = Pattern.compile("^(\d+)x(\d+)(_\d+\.\d+)?$"); private static final Pattern FREQ_PATTERN = Pattern.compile("^(\\d+[.]\\d+)(?:\\s*[*])?(?:\\s*[+])?$"); /** @@ -398,4 +398,4 @@ public String toString() { return name + " " + width + "x" + height + " @ " + xPos + "x" + yPos + " with " + freqOriginal + "Hz"; } } -} \ No newline at end of file +}