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/nativewindow/classes/com | |
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/nativewindow/classes/com')
-rw-r--r-- | src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java index 007a917a6..d65f8c231 100644 --- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java @@ -130,7 +130,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface, if(changed) { if(DEBUG) { System.err.println("JAWTWindow.updateBounds: "+bounds+" -> "+jb); - Thread.dumpStack(); + // Thread.dumpStack(); } bounds.setX(jawtBounds.getX()); bounds.setY(jawtBounds.getY()); @@ -205,7 +205,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface, } try { if(DEBUG) { - System.err.println("JAWTWindow.attachSurfaceHandle(): "+toHexString(layerHandle) + ", bounds "+bounds); + System.err.println("JAWTWindow.attachSurfaceHandle: "+toHexString(layerHandle) + ", bounds "+bounds); } attachSurfaceLayerImpl(layerHandle); offscreenSurfaceLayer = layerHandle; @@ -216,6 +216,17 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface, protected abstract void attachSurfaceLayerImpl(final long layerHandle); @Override + public void layoutSurfaceLayer() throws NativeWindowException { + if( !isOffscreenLayerSurfaceEnabled() ) { + throw new NativeWindowException("Not an offscreen layer surface"); + } + if( 0 != offscreenSurfaceLayer) { + layoutSurfaceLayerImpl(); + } + } + protected void layoutSurfaceLayerImpl() {} + + @Override public final void detachSurfaceLayer() throws NativeWindowException { if( !isOffscreenLayerSurfaceEnabled() ) { throw new java.lang.UnsupportedOperationException("Not an offscreen layer surface"); |