aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt/classes/com/jogamp
diff options
context:
space:
mode:
Diffstat (limited to 'src/newt/classes/com/jogamp')
-rw-r--r--src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java11
-rw-r--r--src/newt/classes/com/jogamp/newt/opengl/GLWindow.java13
2 files changed, 18 insertions, 6 deletions
diff --git a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java
index f5e4ff43f..48c7cd5bf 100644
--- a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java
+++ b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java
@@ -860,12 +860,19 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
}
final int w = getWidth();
final int h = getHeight();
+ final boolean isNValid = newtChild.isNativeValid();
if(DEBUG) {
- System.err.println("NewtCanvasAWT.attachNewtChild.2: size "+w+"x"+h);
+ System.err.println("NewtCanvasAWT.attachNewtChild.2: size "+w+"x"+h+", isNValid "+isNValid);
}
newtChild.setVisible(false);
newtChild.setSize(w, h);
- jawtWindow.setSurfaceScale(null, newtChild.getSurfaceScale(new int[2]));
+ final int[] reqSurfaceScale = new int[2];
+ if( isNValid ) {
+ newtChild.getCurrentSurfaceScale(reqSurfaceScale);
+ } else {
+ newtChild.getRequestedSurfaceScale(reqSurfaceScale);
+ }
+ jawtWindow.setSurfaceScale(reqSurfaceScale);
newtChild.reparentWindow(jawtWindow, -1, -1, Window.REPARENT_HINT_BECOMES_VISIBLE);
newtChild.addSurfaceUpdatedListener(jawtWindow);
if( jawtWindow.isOffscreenLayerSurfaceEnabled() &&
diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
index ae99b7465..25297917b 100644
--- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
+++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
@@ -404,13 +404,18 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
}
@Override
- public final int[] setSurfaceScale(final int[] result, final int[] pixelScale) {
- return window.setSurfaceScale(result, pixelScale);
+ public final void setSurfaceScale(final int[] pixelScale) {
+ window.setSurfaceScale(pixelScale);
}
@Override
- public final int[] getSurfaceScale(final int[] result) {
- return window.getSurfaceScale(result);
+ public final int[] getRequestedSurfaceScale(final int[] result) {
+ return window.getRequestedSurfaceScale(result);
+ }
+
+ @Override
+ public final int[] getCurrentSurfaceScale(final int[] result) {
+ return window.getCurrentSurfaceScale(result);
}
@Override