diff options
Diffstat (limited to 'src/newt')
-rw-r--r-- | src/newt/classes/com/jogamp/newt/impl/WindowImpl.java | 26 | ||||
-rw-r--r-- | src/newt/classes/com/jogamp/newt/opengl/GLWindow.java | 11 |
2 files changed, 18 insertions, 19 deletions
diff --git a/src/newt/classes/com/jogamp/newt/impl/WindowImpl.java b/src/newt/classes/com/jogamp/newt/impl/WindowImpl.java index 0e9114145..72c33f596 100644 --- a/src/newt/classes/com/jogamp/newt/impl/WindowImpl.java +++ b/src/newt/classes/com/jogamp/newt/impl/WindowImpl.java @@ -202,7 +202,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer System.err.println("Window.createNative() START ("+getThreadName()+", "+this+")"); } if( null != parentWindow && - NativeWindow.LOCK_SURFACE_NOT_READY >= parentWindow.lockSurface() ) { + NativeSurface.LOCK_SURFACE_NOT_READY >= parentWindow.lockSurface() ) { throw new NativeWindowException("Parent surface lock: not ready: "+parentWindow); } try { @@ -236,26 +236,24 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer private static long getNativeWindowHandle(NativeWindow nativeWindow) { long handle = 0; if(null!=nativeWindow) { - boolean locked=false; - try { - if( NativeWindow.LOCK_SURFACE_NOT_READY < nativeWindow.lockSurface() ) { - locked=true; + boolean wasLocked = false; + if( NativeSurface.LOCK_SURFACE_NOT_READY < nativeWindow.lockSurface() ) { + wasLocked = true; + try { handle = nativeWindow.getWindowHandle(); if(0==handle) { throw new NativeWindowException("Parent native window handle is NULL, after succesful locking: "+nativeWindow); } - } - } catch (NativeWindowException nwe) { - if(DEBUG_IMPLEMENTATION) { - System.err.println("Window.getNativeWindowHandle: not successful yet: "+nwe); - } - } finally { - if(locked) { + } catch (NativeWindowException nwe) { + if(DEBUG_IMPLEMENTATION) { + System.err.println("Window.getNativeWindowHandle: not successful yet: "+nwe); + } + } finally { nativeWindow.unlockSurface(); } } if(DEBUG_IMPLEMENTATION) { - System.err.println("Window.getNativeWindowHandle: locked "+locked+", "+nativeWindow); + System.err.println("Window.getNativeWindowHandle: locked "+wasLocked+", "+nativeWindow); } } return handle; @@ -809,7 +807,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer NativeWindow parentWindowLocked = null; if( null != parentWindow ) { parentWindowLocked = parentWindow; - if(NativeWindow.LOCK_SURFACE_NOT_READY >= parentWindowLocked.lockSurface() ) { + if(NativeSurface.LOCK_SURFACE_NOT_READY >= parentWindowLocked.lockSurface() ) { throw new NativeWindowException("Parent surface lock: not ready: "+parentWindow); } } diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java index a7104bf1a..d39e0e29b 100644 --- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java +++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java @@ -456,11 +456,12 @@ public class GLWindow implements GLAutoDrawable, Window { if(forceReshape) { sendReshape = true; } - lockSurface(); - try{ - helper.invokeGL(drawable, context, displayAction, initAction); - } finally { - unlockSurface(); + if( NativeSurface.LOCK_SURFACE_NOT_READY < lockSurface() ) { + try{ + helper.invokeGL(drawable, context, displayAction, initAction); + } finally { + unlockSurface(); + } } } } |