diff options
author | Sven Gothel <[email protected]> | 2013-02-20 21:51:40 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-02-20 21:51:40 +0100 |
commit | 14b278536e6f8de2ee6254796b89bd27d5419b72 (patch) | |
tree | 0f4ec76f215cbba178eb6732c1f2a9363df9d6d5 /src/newt/classes | |
parent | cf3ecdb670c0dfecd1394d5b9d5d5588c1bf71f3 (diff) |
OSX/Java7/CALayer + JAWT: Partially Fix AWT/NEWT CALayer 'out of sight' bug, where our CALayer is moved out of the visible area
- same erroneous behavior for GLCanvas and NewtCanvasAWT
- sized-frame: Set framesize and validate() it
- sized-component: Set component preferred size and call frame.pack()
- added workaround 'OffscreenLayerSurface.layoutSurfaceLayer()' to fix CALayer size, which snaps for:
- OK initial size before setVisible: sized-frame and sized-component
- OK resize w/ sized-frame
- OK manual frame resize
- Invisible: w/ sized-component after setVisible()
++
- CALayer-Sublayer (GL) has additional retain/release when added/removed
to be on safe side.
Diffstat (limited to 'src/newt/classes')
-rw-r--r-- | src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java | 14 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java | 2 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java index 195f8af8c..524917780 100644 --- a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java +++ b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java @@ -391,6 +391,18 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto reparentWindow(true, cont); } + @SuppressWarnings("deprecation") + @Override + public void reshape(int x, int y, int width, int height) { + super.reshape(x, y, width, height); + if(DEBUG) { + System.err.println("NewtCanvasAWT.reshape: "+x+"/"+y+" "+width+"x"+height); + } + if(null != jawtWindow && jawtWindow.isOffscreenLayerSurfaceEnabled() ) { + jawtWindow.layoutSurfaceLayer(); + } + } + @Override public void removeNotify() { java.awt.Container cont = AWTMisc.getContainer(this); @@ -459,7 +471,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto // force this AWT Canvas to be focus-able, // since this it is completely covered by the newtChild (z-order). - setFocusable(true); + setFocusable(true); } else { configureNewtChild(false); newtChild.setVisible(false); diff --git a/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java index 08c7a14c2..f47ca327d 100644 --- a/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java @@ -227,7 +227,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl } // else offscreen size is realized via recreation // no native event (fullscreen, some reparenting) positionChanged(true, x, y); - sizeChanged(true, width, height, false); // incl. validation (incl. repositioning) + sizeChanged(true, width, height, false); } if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) && 0 != ( FLAG_IS_VISIBLE & flags) ) { if( !isOffscreenInstance ) { |