From 102338f65b164e70a56cfb3ef03676d9ea9c0049 Mon Sep 17 00:00:00 2001 From: yugecin Date: Mon, 1 May 2017 23:05:19 +0200 Subject: [PATCH] fix game not using borderless when using native res --- src/yugecin/opsudance/core/DisplayContainer.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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 {