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,6 +548,7 @@ final class LinuxDisplay implements DisplayImplementation {
public void resetDisplayMode() { public void resetDisplayMode() {
lockAWT(); lockAWT();
try { try {
if(current_mode != saved_mode)
switchDisplayMode(saved_mode); switchDisplayMode(saved_mode);
if (isXF86VidModeSupported()) if (isXF86VidModeSupported())
doSetGamma(saved_gamma); doSetGamma(saved_gamma);
@ -645,7 +646,7 @@ final class LinuxDisplay implements DisplayImplementation {
current_mode = saved_mode; current_mode = saved_mode;
saved_gamma = getCurrentGammaRamp(); saved_gamma = getCurrentGammaRamp();
current_gamma = saved_gamma; current_gamma = saved_gamma;
return saved_mode; return current_mode;
} finally { } finally {
unlockAWT(); unlockAWT();
} }