diff options
author | Sven Gothel <[email protected]> | 2013-10-09 17:12:33 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-10-09 17:12:33 +0200 |
commit | e96b2d648e7d69b95325fb6b80c6eb508e1e8a14 (patch) | |
tree | 3f9d4cccf811251672a8d9c73e9b8be624e3f018 /src/newt/classes/jogamp | |
parent | 364af76f2ba3e05ba041997e97f4e342fd6f5827 (diff) |
NEWT Reparent/Fullscreen: Add 'waitForPosition(..)' when reparenting or back from fullscreen; JOGLNewtAppletBase: Reparent to pos 32/32, trying to avoid browser window focus/top stealing on X11.
Diffstat (limited to 'src/newt/classes/jogamp')
-rw-r--r-- | src/newt/classes/jogamp/newt/WindowImpl.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java index 300ca5c3f..b7357863f 100644 --- a/src/newt/classes/jogamp/newt/WindowImpl.java +++ b/src/newt/classes/jogamp/newt/WindowImpl.java @@ -1343,6 +1343,9 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer ok = WindowImpl.this.waitForSize(width, height, false, TIMEOUT_NATIVEWINDOW); } if(ok) { + ok = WindowImpl.this.waitForPosition(true, x, y, TIMEOUT_NATIVEWINDOW); + } + if(ok) { requestFocusInt( 0 == parentWindowHandle /* skipFocusAction if top-level */); display.dispatchMessagesNative(); // status up2date } @@ -1375,7 +1378,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer } if(DEBUG_IMPLEMENTATION) { - System.err.println("Window.reparentWindow: END-1 ("+getThreadName()+") windowHandle "+toHexString(windowHandle)+", visible: "+visible+", parentWindowHandle "+toHexString(parentWindowHandle)+", parentWindow "+ Display.hashCodeNullSafe(parentWindow)+" "+getX()+"/"+getY()+" "+getWidth()+"x"+getHeight()); + System.err.println("Window.reparent: END-1 ("+getThreadName()+") windowHandle "+toHexString(windowHandle)+", visible: "+visible+", parentWindowHandle "+toHexString(parentWindowHandle)+", parentWindow "+ Display.hashCodeNullSafe(parentWindow)+" "+getX()+"/"+getY()+" "+getWidth()+"x"+getHeight()); } } finally { if(null!=lifecycleHook) { @@ -1399,7 +1402,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer } } if(DEBUG_IMPLEMENTATION) { - System.err.println("Window.reparentWindow: END-X ("+getThreadName()+") windowHandle "+toHexString(windowHandle)+", visible: "+visible+", parentWindowHandle "+toHexString(parentWindowHandle)+", parentWindow "+ Display.hashCodeNullSafe(parentWindow)+" "+getX()+"/"+getY()+" "+getWidth()+"x"+getHeight()); + System.err.println("Window.reparent: END-X ("+getThreadName()+") windowHandle "+toHexString(windowHandle)+", visible: "+visible+", parentWindowHandle "+toHexString(parentWindowHandle)+", parentWindow "+ Display.hashCodeNullSafe(parentWindow)+" "+getX()+"/"+getY()+" "+getWidth()+"x"+getHeight()); } } } @@ -1410,7 +1413,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer _lock.lock(); try { if(DEBUG_IMPLEMENTATION) { - System.err.println("Window.reparentWindow: ReparentActionRecreate ("+getThreadName()+") windowHandle "+toHexString(windowHandle)+", visible: "+visible+", parentWindowHandle "+toHexString(parentWindowHandle)+", parentWindow "+Display.hashCodeNullSafe(parentWindow)); + System.err.println("Window.reparent: ReparentActionRecreate ("+getThreadName()+") windowHandle "+toHexString(windowHandle)+", visible: "+visible+", parentWindowHandle "+toHexString(parentWindowHandle)+", parentWindow "+Display.hashCodeNullSafe(parentWindow)); } setVisibleActionImpl(true); // native creation requestFocusInt( 0 == parentWindowHandle /* skipFocusAction if top-level */); @@ -2020,6 +2023,9 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer if(ok) { ok = WindowImpl.this.waitForSize(w, h, false, TIMEOUT_NATIVEWINDOW); } + if(ok && !fullscreen) { + ok = WindowImpl.this.waitForPosition(true, x, y, TIMEOUT_NATIVEWINDOW); + } if(ok) { requestFocusInt(fullscreen /* skipFocusAction if fullscreen */); display.dispatchMessagesNative(); // status up2date |