fix game not using borderless when using native res
This commit is contained in:
parent
32aec3ad55
commit
102338f65b
|
@ -349,18 +349,17 @@ public class DisplayContainer implements ErrorDumpable, KeyListener, MouseListen
|
||||||
height = 600;
|
height = 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!OPTION_FULLSCREEN.state) {
|
||||||
|
boolean borderless = (screenWidth == width && screenHeight == height);
|
||||||
|
System.setProperty("org.lwjgl.opengl.Window.undecorated", Boolean.toString(borderless));
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
setDisplayMode(width, height, OPTION_FULLSCREEN.state);
|
setDisplayMode(width, height, OPTION_FULLSCREEN.state);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
EventBus.post(new BubbleNotificationEvent("Failed to change resolution", BubbleNotificationEvent.COMMONCOLOR_RED));
|
EventBus.post(new BubbleNotificationEvent("Failed to change resolution", BubbleNotificationEvent.COMMONCOLOR_RED));
|
||||||
Log.error("Failed to set display mode.", e);
|
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 {
|
public void setDisplayMode(int width, int height, boolean fullscreen) throws Exception {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user