diff options
Diffstat (limited to 'src')
4 files changed, 17 insertions, 15 deletions
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java index b8c68478a..49bed4a15 100644 --- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java @@ -268,7 +268,11 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface, } // Thread.dumpStack(); } - invalidateNative(); + { + final long osl = offscreenSurfaceLayer; + offscreenSurfaceLayer = 0; + invalidateNative(osl); + } jawt = null; awtConfig = null; offscreenSurfaceLayer = 0; // Bug 1389 @@ -285,7 +289,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface, maxPixelScale[1] = ScalableSurface.IDENTITY_PIXELSCALE; hasPixelScaleChanged = false; } - protected abstract void invalidateNative(); + protected abstract void invalidateNative(final long offscreenSurfaceLayer); /** * Set a new {@link AWTGraphicsConfiguration} instance, @@ -544,19 +548,17 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface, if(DEBUG) { System.err.println("JAWTWindow.detachSurfaceHandle(): osh "+toHexString(offscreenSurfaceLayer)+" - "+Thread.currentThread().getName()); } - detachSurfaceLayerImpl(offscreenSurfaceLayer, detachSurfaceLayerNotify); + { + final long osl = offscreenSurfaceLayer; + offscreenSurfaceLayer = 0; + detachSurfaceLayerImpl(osl); + } } - private final Runnable detachSurfaceLayerNotify = new Runnable() { - @Override - public void run() { - offscreenSurfaceLayer = 0; - } - }; /** * @param detachNotify Runnable to be called before native detachment */ - protected void detachSurfaceLayerImpl(final long layerHandle, final Runnable detachNotify) { + protected void detachSurfaceLayerImpl(final long layerHandle) { throw new UnsupportedOperationException("offscreen layer not supported"); } diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java index 4e89709f2..4cba086e0 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java +++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java @@ -83,12 +83,12 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface { } @Override - protected void invalidateNative() { + protected void invalidateNative(final long _offscreenSurfaceLayer) { if(DEBUG) { System.err.println("MacOSXJAWTWindow.invalidateNative(): osh-enabled "+isOffscreenLayerSurfaceEnabled()+ ", osd-set "+offscreenSurfaceDrawableSet+ ", osd "+toHexString(offscreenSurfaceDrawable)+ - ", osl "+toHexString(getAttachedSurfaceLayer())+ + ", osl "+toHexString(_offscreenSurfaceLayer)+ ", jsl "+toHexString(jawtSurfaceLayersHandle)+ ", rsl "+toHexString(rootSurfaceLayer)+ ", wh "+toHexString(windowHandle)+" - "+Thread.currentThread().getName()); @@ -99,7 +99,6 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface { if(0 != windowHandle) { OSXUtil.DestroyNSWindow(windowHandle); } - final long _offscreenSurfaceLayer = getAttachedSurfaceLayer(); // Bug 1389 OSXUtil.RunOnMainThread(false, true /* kickNSApp */, new Runnable() { @Override public void run() { diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/WindowsJAWTWindow.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/WindowsJAWTWindow.java index 655dadd6b..892a9d239 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/WindowsJAWTWindow.java +++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/WindowsJAWTWindow.java @@ -64,7 +64,7 @@ public class WindowsJAWTWindow extends JAWTWindow { } @Override - protected void invalidateNative() { + protected void invalidateNative(final long _offscreenSurfaceLayer) { windowHandle = 0; } diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11JAWTWindow.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11JAWTWindow.java index 80cf3ba6f..4d50d3882 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11JAWTWindow.java +++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11JAWTWindow.java @@ -61,7 +61,8 @@ public class X11JAWTWindow extends JAWTWindow { } @Override - protected void invalidateNative() { } + protected void invalidateNative(final long _offscreenSurfaceLayer) { + } @Override protected JAWT fetchJAWTImpl() throws NativeWindowException { |