From 5c85264b092352998356c5b8ec804be72c4abd23 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Tue, 15 Sep 2020 16:18:58 -0400 Subject: [PATCH] implement a terrible hack for #104 so we can ship --- core/src/processing/opengl/PSurfaceJOGL.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/core/src/processing/opengl/PSurfaceJOGL.java b/core/src/processing/opengl/PSurfaceJOGL.java index 62027b505..e03d57956 100644 --- a/core/src/processing/opengl/PSurfaceJOGL.java +++ b/core/src/processing/opengl/PSurfaceJOGL.java @@ -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()) {