Linux: Avoid unneccessary mode switching in LinuxDisplay.resetDisplayMode (patch by buggs)
This commit is contained in:
parent
acbd39a6c1
commit
8896ec3631
|
@ -548,7 +548,8 @@ final class LinuxDisplay implements DisplayImplementation {
|
||||||
public void resetDisplayMode() {
|
public void resetDisplayMode() {
|
||||||
lockAWT();
|
lockAWT();
|
||||||
try {
|
try {
|
||||||
switchDisplayMode(saved_mode);
|
if(current_mode != saved_mode)
|
||||||
|
switchDisplayMode(saved_mode);
|
||||||
if (isXF86VidModeSupported())
|
if (isXF86VidModeSupported())
|
||||||
doSetGamma(saved_gamma);
|
doSetGamma(saved_gamma);
|
||||||
} catch (LWJGLException e) {
|
} catch (LWJGLException e) {
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue