Fix crash when minimizing on Windows during rendering (fixes #140)

Hopefully, haven't actually tried it cause, you know, Windows (and minimizing
with just xfwm4 doesn't exhibit the same behavior).
This commit is contained in:
Jonas Herzig
2020-05-08 10:17:49 +02:00
parent a1cee391fb
commit 62c6b36f08

View File

@@ -557,10 +557,18 @@ public class VideoRenderer implements RenderInfo {
private boolean displaySizeChanged() { private boolean displaySizeChanged() {
//#if MC>=11400 //#if MC>=11400
return displayWidth != getWindow(mc).getWidth() || displayHeight != getWindow(mc).getHeight(); int realWidth = getWindow(mc).getWidth();
int realHeight = getWindow(mc).getHeight();
//#else //#else
//$$ return displayWidth != Display.getWidth() || displayHeight != Display.getHeight(); //$$ int realWidth = Display.getWidth();
//$$ int realHeight = Display.getHeight();
//#endif //#endif
if (realWidth == 0 || realHeight == 0) {
// These can be zero on Windows if minimized.
// Creating zero-sized framebuffers however will throw an error, so we never want to switch to zero values.
return false;
}
return displayWidth != realWidth || displayHeight != realHeight;
} }
private void updateDisplaySize() { private void updateDisplaySize() {