Linux: Avoid unneccessary mode switching in LinuxDisplay.resetDisplayMode (patch by buggs)

This commit is contained in:
Elias Naur 2008-08-12 17:05:26 +00:00
parent acbd39a6c1
commit 8896ec3631
1 changed files with 3 additions and 2 deletions

View File

@ -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();
}