aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-02-08 17:47:17 +0100
committerSven Gothel <[email protected]>2012-02-08 17:47:17 +0100
commitddd375375025fb83aba90c80b9a089876dad5434 (patch)
tree132ebdeda8da17225f9117325f625720bae143f2
parent6bdf15f28da748c974536e799a9f6541e3615948 (diff)
NEWT: Fix deadlock w/ AWT parent (NewtCanvasAWT) - focus window @ creation after releasing parent lock (AWT lock).
-rw-r--r--src/newt/classes/jogamp/newt/WindowImpl.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java
index 29056ee04..a76cd5493 100644
--- a/src/newt/classes/jogamp/newt/WindowImpl.java
+++ b/src/newt/classes/jogamp/newt/WindowImpl.java
@@ -285,6 +285,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
if( null != parentWindow && ( autoPosition || 0>getX() || 0>getY() ) ) {
definePosition(0, 0);
}
+ boolean postParentlockFocus = false;
try {
if(validateParentWindowHandle()) {
if(screenReferenceAdded) {
@@ -306,9 +307,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
fullScreenAction.run();
}
}
- // harmonize focus behavior for all platforms: focus on creation
- requestFocusInt(isFullscreen() /* skipFocusAction */, true/* force */);
- ((DisplayImpl) screen.getDisplay()).dispatchMessagesNative(); // status up2date
+ postParentlockFocus = true;
}
}
}
@@ -317,6 +316,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
parentWindow.unlockSurface();
}
}
+ if(postParentlockFocus) {
+ // harmonize focus behavior for all platforms: focus on creation
+ requestFocusInt(isFullscreen() /* skipFocusAction */, true/* force */);
+ ((DisplayImpl) screen.getDisplay()).dispatchMessagesNative(); // status up2date
+ }
if(DEBUG_IMPLEMENTATION) {
System.err.println("Window.createNative() END ("+getThreadName()+", "+this+")");
}