aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt/classes/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-09-16 04:18:00 +0200
committerSven Gothel <[email protected]>2011-09-16 04:18:00 +0200
commit0e9935a8f9e2969e4ddd96dbc043473d9f336c3a (patch)
tree2e8445423ce8d6b6bdf486e396bfa2d7349fc066 /src/newt/classes/jogamp
parent417b83ebd6c4147a290deeb88047bf64e2a27917 (diff)
NEWT/Reparenting: Give Composite WM some slack, sleep(100); Minor edits/fixes
Diffstat (limited to 'src/newt/classes/jogamp')
-rw-r--r--src/newt/classes/jogamp/newt/WindowImpl.java16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java
index bed81cd02..16bd221df 100644
--- a/src/newt/classes/jogamp/newt/WindowImpl.java
+++ b/src/newt/classes/jogamp/newt/WindowImpl.java
@@ -1092,9 +1092,14 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
if( ACTION_NATIVE_REPARENTING == reparentAction ) {
DisplayImpl display = (DisplayImpl) screen.getDisplay();
display.dispatchMessagesNative(); // status up2date
+
if(wasVisible) {
setVisibleImpl(false, x, y, width, height);
WindowImpl.this.waitForVisible(false, true);
+ // some composite WM behave slacky .. give 'em chance to change state -> invisible,
+ // even though we do exactly that (KDE+Composite)
+ try { Thread.sleep(100); } catch (InterruptedException e) { }
+ display.dispatchMessagesNative(); // status up2date
}
// Lock parentWindow only during reparenting (attempt)
@@ -1102,8 +1107,10 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
if( null != parentWindow ) {
parentWindowLocked = parentWindow;
if( NativeSurface.LOCK_SURFACE_NOT_READY >= parentWindowLocked.lockSurface() ) {
- throw new NativeWindowException("Parent surface lock: not ready: "+parentWindow);
+ throw new NativeWindowException("Parent surface lock: not ready: "+parentWindowLocked);
}
+ // update native handle, locked state
+ parentWindowHandle = parentWindowLocked.getWindowHandle();
} else {
parentWindowLocked = null;
}
@@ -1476,6 +1483,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
public void setFocusAction(FocusRunnable focusAction) {
this.focusAction = focusAction;
}
+
+ /** Called by native requestFocusImpl() */
protected boolean focusAction() {
if(DEBUG_IMPLEMENTATION) {
System.err.println("Window.focusAction() START - "+getThreadName()+", focusAction: "+focusAction+" - windowHandle "+toHexString(getWindowHandle()));
@@ -1546,7 +1555,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
// set current state
WindowImpl.this.fullscreen = fullscreen;
-
+
if( nativeFullscreenChange ) {
int x,y,w,h;
@@ -2159,7 +2168,6 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
for(long sleep = timeOut; 0<sleep && this.visible != visible; sleep-=10 ) {
display.dispatchMessagesNative(); // status up2date
try { Thread.sleep(10); } catch (InterruptedException ie) {}
- sleep -=10;
}
if(this.visible != visible) {
final String msg = "Visibility not reached as requested within "+timeOut+"ms : requested "+visible+", is "+this.visible;
@@ -2202,7 +2210,6 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
} else {
display.dispatchMessagesNative(); // status up2date
try { Thread.sleep(10); } catch (InterruptedException ie) {}
- sleep -=10;
}
}
if(!reached) {
@@ -2225,7 +2232,6 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
} else {
display.dispatchMessagesNative(); // status up2date
try { Thread.sleep(10); } catch (InterruptedException ie) {}
- sleep -=10;
}
}
if(!reached) {