From 8896ec36317cba76b8551ed3623348ce7bd45422 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Tue, 12 Aug 2008 17:05:26 +0000 Subject: [PATCH] Linux: Avoid unneccessary mode switching in LinuxDisplay.resetDisplayMode (patch by buggs) --- src/java/org/lwjgl/opengl/LinuxDisplay.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/java/org/lwjgl/opengl/LinuxDisplay.java b/src/java/org/lwjgl/opengl/LinuxDisplay.java index 0df8efda..201cd161 100644 --- a/src/java/org/lwjgl/opengl/LinuxDisplay.java +++ b/src/java/org/lwjgl/opengl/LinuxDisplay.java @@ -548,7 +548,8 @@ final class LinuxDisplay implements DisplayImplementation { public void resetDisplayMode() { lockAWT(); try { - switchDisplayMode(saved_mode); + if(current_mode != saved_mode) + switchDisplayMode(saved_mode); if (isXF86VidModeSupported()) doSetGamma(saved_gamma); } catch (LWJGLException e) { @@ -645,7 +646,7 @@ final class LinuxDisplay implements DisplayImplementation { current_mode = saved_mode; saved_gamma = getCurrentGammaRamp(); current_gamma = saved_gamma; - return saved_mode; + return current_mode; } finally { unlockAWT(); }