From d6b4c7dd3546b8de876a9ddcbf5f1f56be8ef281 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 31 Jan 2023 09:15:59 +0100 Subject: NEWT Regression: Move superSizeChangedOffThread() back to iOS/MacOS WindowDriver, used to call the super class method. Regression of commit cfc35549810d3a0fb5eeb866c9450417e48cd8a1 Note to myself: You can't enforce a 'this' method call overridden with a virtual from a subclass. --- src/newt/classes/jogamp/newt/WindowImpl.java | 12 ------------ .../classes/jogamp/newt/driver/ios/WindowDriver.java | 16 ++++++++++++++-- .../classes/jogamp/newt/driver/macosx/WindowDriver.java | 14 +++++++++++++- 3 files changed, 27 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java index 4018c8b78..565e1e471 100644 --- a/src/newt/classes/jogamp/newt/WindowImpl.java +++ b/src/newt/classes/jogamp/newt/WindowImpl.java @@ -5175,18 +5175,6 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer } } - protected void sizeChangedOffThread(final boolean defer, final boolean windowUnits, final int newWidth, final int newHeight, final boolean force) { - if( defer ) { - new InterruptSource.Thread() { - @Override - public void run() { - WindowImpl.this.sizeChanged(false /* defer */, windowUnits, newWidth, newHeight, force); - } }.start(); - } else { - WindowImpl.this.sizeChanged(false /* defer */, windowUnits, newWidth, newHeight, force); - } - } - private boolean waitForSize(final int w, final int h, final boolean failFast, final long timeOut) { final DisplayImpl display = (DisplayImpl) screen.getDisplay(); display.dispatchMessagesNative(); // status up2date diff --git a/src/newt/classes/jogamp/newt/driver/ios/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/ios/WindowDriver.java index 98700e5fe..280adf71a 100644 --- a/src/newt/classes/jogamp/newt/driver/ios/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/ios/WindowDriver.java @@ -187,7 +187,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl } @Override - protected void createNativeImpl(boolean[] positionModified) { + protected void createNativeImpl(final boolean[] positionModified) { final AbstractGraphicsConfiguration cfg = GraphicsConfigurationFactory.getFactory(getScreen().getDisplay().getGraphicsDevice(), capsRequested).chooseGraphicsConfiguration( capsRequested, capsRequested, capabilitiesChooser, getScreen().getGraphicsScreen(), VisualIDHolder.VID_UNDEFINED); if (null == cfg) { @@ -585,13 +585,25 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl } } ); } } - super.sizeChangedOffThread(defer, windowUnits, newWidth, newHeight, force); + superSizeChangedOffThread(defer, windowUnits, newWidth, newHeight, force); return true; } else { return false; } } + private void superSizeChangedOffThread(final boolean defer, final boolean windowUnits, final int newWidth, final int newHeight, final boolean force) { + if( defer ) { + new InterruptSource.Thread() { + @Override + public void run() { + WindowDriver.super.sizeChanged(false /* defer */, windowUnits, newWidth, newHeight, force); + } }.start(); + } else { + WindowDriver.super.sizeChanged(false /* defer */, windowUnits, newWidth, newHeight, force); + } + } + // // Accumulated actions // diff --git a/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java index f7339292f..4326dbc13 100644 --- a/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java @@ -630,13 +630,25 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl } } ); } } - super.sizeChangedOffThread(defer, windowUnits, newWidth, newHeight, force); + superSizeChangedOffThread(defer, windowUnits, newWidth, newHeight, force); return true; } else { return false; } } + private void superSizeChangedOffThread(final boolean defer, final boolean windowUnits, final int newWidth, final int newHeight, final boolean force) { + if( defer ) { + new InterruptSource.Thread() { + @Override + public void run() { + WindowDriver.super.sizeChanged(false /* defer */, windowUnits, newWidth, newHeight, force); + } }.start(); + } else { + WindowDriver.super.sizeChanged(false /* defer */, windowUnits, newWidth, newHeight, force); + } + } + // // Accumulated actions // -- cgit v1.2.3