v2.4.0: fixed various specific bugs caused by launching in fullscreen

This commit is contained in:
Evan Debenham
2024-03-14 12:42:37 -04:00
parent fc3cbf395a
commit fd53f18089
2 changed files with 5 additions and 8 deletions

View File

@@ -173,10 +173,9 @@ public class DesktopLauncher {
config.setMaximized(SPDSettings.windowMaximized()); config.setMaximized(SPDSettings.windowMaximized());
//going fullscreen on launch is still buggy on macOS, so game enters it slightly later //going fullscreen on launch is a bit buggy
if (SPDSettings.fullscreen() && !SharedLibraryLoader.isMac) { // so game always starts windowed and then switches in DesktopPlatformSupport.updateSystemUI
config.setFullscreenMode(Lwjgl3ApplicationConfiguration.getDisplayMode()); //config.setFullscreenMode(Lwjgl3ApplicationConfiguration.getDisplayMode());
}
//records whether window is maximized or not for settings //records whether window is maximized or not for settings
DesktopWindowListener listener = new DesktopWindowListener(); DesktopWindowListener listener = new DesktopWindowListener();

View File

@@ -45,16 +45,14 @@ public class DesktopPlatformSupport extends PlatformSupport {
public void updateDisplaySize() { public void updateDisplaySize() {
if (previousSizes == null){ if (previousSizes == null){
previousSizes = new Point[2]; previousSizes = new Point[2];
previousSizes[0] = previousSizes[1] = new Point(Game.width, Game.height); previousSizes[1] = SPDSettings.windowResolution();
} else { } else {
previousSizes[1] = previousSizes[0]; previousSizes[1] = previousSizes[0];
previousSizes[0] = new Point(Game.width, Game.height);
} }
previousSizes[0] = new Point(Game.width, Game.height);
if (!SPDSettings.fullscreen()) { if (!SPDSettings.fullscreen()) {
SPDSettings.windowResolution( previousSizes[0] ); SPDSettings.windowResolution( previousSizes[0] );
} }
//TODO fixes an in libGDX v1.11.0 with macOS displays
Gdx.gl.glViewport(0, 0, Gdx.graphics.getBackBufferWidth(), Gdx.graphics.getBackBufferHeight());
} }
@Override @Override