diff --git a/src/yugecin/opsudance/core/DisplayContainer.java b/src/yugecin/opsudance/core/DisplayContainer.java index 278a6de1..6a92ea79 100644 --- a/src/yugecin/opsudance/core/DisplayContainer.java +++ b/src/yugecin/opsudance/core/DisplayContainer.java @@ -349,18 +349,17 @@ public class DisplayContainer implements ErrorDumpable, KeyListener, MouseListen height = 600; } + if (!OPTION_FULLSCREEN.state) { + boolean borderless = (screenWidth == width && screenHeight == height); + System.setProperty("org.lwjgl.opengl.Window.undecorated", Boolean.toString(borderless)); + } + try { setDisplayMode(width, height, OPTION_FULLSCREEN.state); } catch (Exception e) { EventBus.post(new BubbleNotificationEvent("Failed to change resolution", BubbleNotificationEvent.COMMONCOLOR_RED)); Log.error("Failed to set display mode.", e); } - - if (OPTION_FULLSCREEN.state) { - // set borderless window if dimensions match screen size - boolean borderless = (screenWidth == width && screenHeight == height); - System.setProperty("org.lwjgl.opengl.Window.undecorated", Boolean.toString(borderless)); - } } public void setDisplayMode(int width, int height, boolean fullscreen) throws Exception {