Skip to content

Commit

Permalink
Move setResizable to after resize, before updateDisplay
Browse files Browse the repository at this point in the history
Probably better than doing it after updateDisplay. Also calls setResizable less times.
  • Loading branch information
comp500 authored Jul 24, 2018
1 parent 1e65eae commit 11f117a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/main/java/com/hancinworld/fw/proxy/ClientProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -215,19 +215,18 @@ public void toggleFullScreen(boolean goFullScreen, int desiredMonitor) {
client.gameSettings.saveOptions();
}
Display.setFullscreen(false);
Display.setResizable(!goFullScreen);
Display.setDisplayMode(new DisplayMode((int) newBounds.getWidth(), (int) newBounds.getHeight()));
Display.setLocation(newBounds.x, newBounds.y);

client.resize((int) newBounds.getWidth(), (int) newBounds.getHeight());
Display.setVSyncEnabled(client.gameSettings.enableVsync);
client.updateDisplay();

// Related to the Forge fix for MC-68754
if (!goFullScreen) {
Display.setResizable(false);
Display.setResizable(true);
}
Display.setResizable(!goFullScreen);
Display.setVSyncEnabled(client.gameSettings.enableVsync);
client.updateDisplay();

} catch (LWJGLException e) {
e.printStackTrace();
}
Expand Down

0 comments on commit 11f117a

Please sign in to comment.