diff options
-rw-r--r-- | src/jogl/classes/javax/media/opengl/awt/GLCanvas.java | 14 | ||||
-rw-r--r-- | src/jogl/classes/jogamp/opengl/GLDrawableImpl.java | 1 |
2 files changed, 8 insertions, 7 deletions
diff --git a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java index efdc69ed8..2f7fef9be 100644 --- a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java +++ b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java @@ -580,14 +580,14 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing if( Beans.isDesignTime() || !isDisplayable() || 0 >= _drawable.getWidth() || 0 >= _drawable.getHeight() ) { return false; // early out! } - // make sure drawable realization happens on AWT EDT, due to AWTTree lock - AWTEDTExecutor.singleton.invoke(getTreeLock(), true, setRealizedOnEDTAction); - final boolean res = _drawable.isRealized(); + // Make sure drawable realization happens on AWT-EDT and only there. Consider the AWTTree lock! + final boolean res0 = AWTEDTExecutor.singleton.invoke(getTreeLock(), false /* allowOnNonEDT */, true /* wait */, setRealizedOnEDTAction); + final boolean res1 = res0 && _drawable.isRealized(); if(DEBUG) { - System.err.println(getThreadName()+": Realized Drawable: "+res+", "+_drawable.toString()); + System.err.println(getThreadName()+": Realized Drawable: invoked "+res0+", probedIsRealized "+res1+", "+_drawable.toString()); Thread.dumpStack(); } - return res; + return res1; } return false; } @@ -879,7 +879,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing ",\n\thandle 0x"+Long.toHexString(getHandle())+ ",\n\tDrawable size "+dw+"x"+dh+ ",\n\tAWT pos "+getX()+"/"+getY()+", size "+getWidth()+"x"+getHeight()+ - ",\n\tvisible "+isVisible()+ + ",\n\tvisible "+isVisible()+", displayable "+isDisplayable()+ ",\n\t"+awtConfig+"]"; } @@ -949,7 +949,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing validateGLDrawable(); // immediate attempt to recreate the drawable } else { if(null != awtConfig) { - AWTEDTExecutor.singleton.invoke(getTreeLock(), true, disposeAbstractGraphicsDeviceActionOnEDT); + AWTEDTExecutor.singleton.invoke(getTreeLock(), true /* allowOnNonEDT */, true /* wait */, disposeAbstractGraphicsDeviceActionOnEDT); } awtConfig=null; } diff --git a/src/jogl/classes/jogamp/opengl/GLDrawableImpl.java b/src/jogl/classes/jogamp/opengl/GLDrawableImpl.java index 2d062eaf1..c0c28a5f2 100644 --- a/src/jogl/classes/jogamp/opengl/GLDrawableImpl.java +++ b/src/jogl/classes/jogamp/opengl/GLDrawableImpl.java @@ -166,6 +166,7 @@ public abstract class GLDrawableImpl implements GLDrawable { if ( realized != realizedArg ) { // volatile: OK (locked below) if(DEBUG) { System.err.println(getThreadName() + ": setRealized: "+getClass().getSimpleName()+" "+realized+" -> "+realizedArg); + Thread.dumpStack(); } AbstractGraphicsDevice aDevice = surface.getGraphicsConfiguration().getScreen().getDevice(); if(realizedArg) { |