From bf701532ca7013889c07e00da77ee51e6d4229b4 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Thu, 3 Mar 2022 11:59:09 -0500 Subject: [PATCH] bring back frameMoved() so that Python Mode can override it --- core/src/processing/core/PApplet.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/core/src/processing/core/PApplet.java b/core/src/processing/core/PApplet.java index 40ea55603..35525cfa6 100644 --- a/core/src/processing/core/PApplet.java +++ b/core/src/processing/core/PApplet.java @@ -10045,6 +10045,17 @@ public class PApplet implements PConstants { } + /** + * When running from the PDE, this saves the window position for + * next time the sketch is run. Needs to remain a separate method + * so that it can be overridden by Python Mode. + */ + public void frameMoved(int newX, int newY) { + System.err.println(EXTERNAL_MOVE + " " + newX + " " + newY); + System.err.flush(); // doesn't seem to help or hurt + } + + /** * Internal use only: called by Surface objects to queue a position * event to call windowPositioned() when it's safe, which is after @@ -10053,10 +10064,7 @@ public class PApplet implements PConstants { */ public void postWindowMoved(int newX, int newY) { if (external && !fullScreen) { - // When running from the PDE, this saves the window position - // for next time the sketch is run. - System.err.println(EXTERNAL_MOVE + " " + newX + " " + newY); - System.err.flush(); // doesn't seem to help or hurt + frameMoved(newX, newY); } windowEventQueue.put("x", newX);