diff options
author | Sven Gothel <[email protected]> | 2011-11-10 01:21:50 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-11-10 01:21:50 +0100 |
commit | d1ac91ae3e8fab5176cb677a20fd764f04a00cc8 (patch) | |
tree | 22d22d3c0c1acbfbfa9e7e853a99390e468cfb21 /src/newt/classes/jogamp | |
parent | 44b86776d35668c12ccc698b92ae955bde8f250a (diff) |
Fix regression JAWTWindow/AWTGraphicsConfiguration updateGraphicsConfiguration() of commit 46542168d64b37f544f61802693f15b59b224e4e
While introducing NewtCanvasAWT's lifetime reference of (JAWTWindow) nativeWindow
using updateGraphicsConfiguration() to determine the actual config values at addNotify(),
it was overseen that the AWTGraphicsDevice needs to be re-validated.
JAWTWindow's validateNative() ensures that the AWTGraphicsDevice reflects the platform
native handle where required (X11).
Diffstat (limited to 'src/newt/classes/jogamp')
-rw-r--r-- | src/newt/classes/jogamp/newt/awt/event/NewtFactoryAWT.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/newt/classes/jogamp/newt/awt/event/NewtFactoryAWT.java b/src/newt/classes/jogamp/newt/awt/event/NewtFactoryAWT.java index 1d11887fb..9b812d22a 100644 --- a/src/newt/classes/jogamp/newt/awt/event/NewtFactoryAWT.java +++ b/src/newt/classes/jogamp/newt/awt/event/NewtFactoryAWT.java @@ -76,10 +76,19 @@ public class NewtFactoryAWT extends NewtFactory { if(! ( nw instanceof JAWTWindow ) ) { throw new NativeWindowException("Not an AWT NativeWindow: "+nw); } + if(DEBUG_IMPLEMENTATION) { + System.err.println("NewtFactoryAWT.updateGraphicsConfiguration: (pre) "+awtComp+" -> "+nw); + } final AWTGraphicsConfiguration awtConfig = (AWTGraphicsConfiguration) nw.getGraphicsConfiguration(); awtConfig.updateGraphicsConfiguration(awtComp); + // lockSurface() re-issues JAWTWindow's native validation + if( NativeSurface.LOCK_SURFACE_NOT_READY >= nw.lockSurface() ) { + throw new NativeWindowException("could not lock "+nw); + } + nw.unlockSurface(); + if(DEBUG_IMPLEMENTATION) { - System.err.println("NewtFactoryAWT.updateGraphicsConfiguration: "+awtComp+" -> "+nw); + System.err.println("NewtFactoryAWT.updateGraphicsConfiguration: (post) "+awtComp+" -> "+nw); } } |