diff options
-rw-r--r-- | src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtAppletBase.java | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtAppletBase.java b/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtAppletBase.java index d17d2e77c..2c4f25804 100644 --- a/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtAppletBase.java +++ b/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtAppletBase.java @@ -166,18 +166,19 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener { // Closing action: back to parent! @Override public void windowDestroyNotify(WindowEvent e) { - if( isValid() && WindowClosingMode.DO_NOTHING_ON_CLOSE == glWindow.getDefaultCloseOperation() ) { - if(null == glWindow.getParent()) { - // we may be called directly by the native EDT - new Thread(new Runnable() { - @Override - public void run() { - if( glWindow.isNativeValid() ) { - glWindow.reparentWindow(awtParent); - } - } - }).start(); - } + if( isValid() && WindowClosingMode.DO_NOTHING_ON_CLOSE == glWindow.getDefaultCloseOperation() && + null == glWindow.getParent() && null != awtParent && 0 != awtParent.getWindowHandle() ) + { + Thread.dumpStack(); + // we may be called directly by the native EDT + new Thread(new Runnable() { + @Override + public void run() { + if( glWindow.isNativeValid() && null != awtParent && 0 != awtParent.getWindowHandle() ) { + glWindow.reparentWindow(awtParent); + } + } + }).start(); } } } ); |