implement a terrible hack for #104 so we can ship

This commit is contained in:
Ben Fry
2020-09-15 16:18:58 -04:00
parent 2e79478b0c
commit 5c85264b09
+14 -2
View File
@@ -3,7 +3,7 @@
/*
Part of the Processing project - http://processing.org
Copyright (c) 2012-15 The Processing Foundation
Copyright (c) 2012-20 The Processing Foundation
Copyright (c) 2004-12 Ben Fry and Casey Reas
Copyright (c) 2001-04 Massachusetts Institute of Technology
@@ -114,6 +114,9 @@ public class PSurfaceJOGL implements PSurface {
protected boolean external = false;
// Workaround for https://github.com/processing/processing4/issues/124
static private boolean issue124 = PApplet.platform == PConstants.MACOS;
public PSurfaceJOGL(PGraphics graphics) {
this.graphics = graphics;
@@ -408,7 +411,11 @@ public class PSurfaceJOGL implements PSurface {
window.setSurfaceScale(new float[] { surfaceScale, surfaceScale });
window.setSize(sketchWidth * windowScaleFactor, sketchHeight * windowScaleFactor);
window.setResizable(true);
if (issue124) {
window.setResizable(true);
} else {
window.setResizable(false);
}
setSize(sketchWidth, sketchHeight);
if (fullScreen) {
PApplet.hideMenuBar();
@@ -949,6 +956,11 @@ public class PSurfaceJOGL implements PSurface {
pgl.endRender(sketch.sketchWindowColor());
}
PGraphicsOpenGL.completeFinishedPixelTransfers();
if (issue124) {
setResizable(false);
issue124 = false;
}
}
if (sketch.exitCalled()) {