mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-26 23:13:15 +00:00
Minecraft is now Unobfuscated and requires Java 25 Lots of changes/code cleanup. See https://github.com/MinecraftForge/MinecraftForge-Experimental/tree/26.1-dev for non-squashed commits. Co-authored-by: Paint_Ninja <[email protected]>
32 lines
2.0 KiB
Diff
32 lines
2.0 KiB
Diff
--- a/com/mojang/blaze3d/platform/Window.java
|
|
+++ b/com/mojang/blaze3d/platform/Window.java
|
|
@@ -97,8 +_,9 @@
|
|
Monitor monitor = this.screenManager.getMonitor(GLFW.glfwGetPrimaryMonitor());
|
|
this.windowedWidth = this.width = allowedWindowMinSize(displayData.width());
|
|
this.windowedHeight = this.height = allowedWindowMinSize(displayData.height());
|
|
- this.handle = this.createWindow(backend, this.width, this.height, title, this.fullscreen && monitor != null ? monitor.getMonitor() : 0L);
|
|
+ this.handle = net.minecraftforge.fml.loading.ImmediateWindowHandler.setupMinecraftWindow(this.width, this.height, title, this.fullscreen && monitor != null ? monitor.getMonitor() : 0L, () -> backend);
|
|
this.backend = backend;
|
|
+ if (!net.minecraftforge.fml.loading.ImmediateWindowHandler.positionWindow(Optional.ofNullable(monitor), w->this.width = this.windowedWidth = w, h->this.height = this.windowedHeight = h, x->this.x = this.windowedX = x, y->this.y = this.windowedY = y)) {
|
|
if (monitor != null) {
|
|
VideoMode videomode = monitor.getPreferredVidMode(this.fullscreen ? this.preferredFullscreenVideoMode : Optional.empty());
|
|
this.windowedX = this.x = monitor.getX() + videomode.getWidth() / 2 - this.width / 2;
|
|
@@ -110,6 +_,7 @@
|
|
this.windowedX = this.x = aint1[0];
|
|
this.windowedY = this.y = aint[0];
|
|
}
|
|
+ }
|
|
|
|
this.setMode();
|
|
this.refreshFramebufferSize();
|
|
@@ -300,6 +_,9 @@
|
|
GLFW.glfwGetFramebufferSize(this.handle, aint, aint1);
|
|
this.framebufferWidth = aint[0] > 0 ? aint[0] : 1;
|
|
this.framebufferHeight = aint1[0] > 0 ? aint1[0] : 1;
|
|
+ if (this.framebufferHeight == 0 || this.framebufferWidth == 0) {
|
|
+ net.minecraftforge.fml.loading.ImmediateWindowHandler.updateFBSize(w -> this.framebufferWidth = w, h -> this.framebufferHeight = h);
|
|
+ }
|
|
}
|
|
|
|
private void onResize(final long handle, final int newWidth, final int newHeight) {
|