summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-09-07 02:09:23 +0200
committerSven Gothel <[email protected]>2011-09-07 02:09:23 +0200
commit6ff7ba18a549a3fef9fcb01a2944bd0907799864 (patch)
treeed3f5d8276b8038a614553df6ab714a835e9631f /src
parent2a21725feb298462900c5f3af849e83a524fbddf (diff)
Fix commit e1ecd85a9d5877861cde35baababb298d1339898 - send resize event
Completes fix 2934c9814daf7ae053c3f03957961a2e62125aee Turns out it's more safe to send out the resize events to the listener, since the native event messaging is not reliable in some cases.
Diffstat (limited to 'src')
-rw-r--r--src/newt/classes/jogamp/newt/WindowImpl.java21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java
index 6631505c1..ca4188e94 100644
--- a/src/newt/classes/jogamp/newt/WindowImpl.java
+++ b/src/newt/classes/jogamp/newt/WindowImpl.java
@@ -692,6 +692,9 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
} finally {
windowLock.unlock();
}
+ if( nativeWindowCreated || madeVisible ) {
+ sendWindowEvent(WindowEvent.EVENT_WINDOW_RESIZED); // trigger a resize/relayout and repaint to listener
+ }
}
private class VisibleAction implements Runnable {
@@ -1121,10 +1124,18 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
} finally {
windowLock.unlock();
}
-
- if(wasVisible && ACTION_NATIVE_CREATION == reparentAction) {
- // This may run on the new Display/Screen connection, hence a new EDT task
- runOnEDTIfAvail(true, reparentActionRecreate);
+ if(wasVisible) {
+ switch (reparentAction) {
+ case ACTION_NATIVE_REPARENTING:
+ // trigger a resize/relayout and repaint to listener
+ sendWindowEvent(WindowEvent.EVENT_WINDOW_RESIZED);
+ break;
+
+ case ACTION_NATIVE_CREATION:
+ // This may run on the new Display/Screen connection, hence a new EDT task
+ runOnEDTIfAvail(true, reparentActionRecreate);
+ break;
+ }
}
if(DEBUG_IMPLEMENTATION) {
System.err.println("Window.reparentWindow: END-X ("+getThreadName()+") windowHandle "+toHexString(windowHandle)+", visible: "+visible+", parentWindowHandle "+toHexString(parentWindowHandle)+", parentWindow "+ Display.hashCodeNullSafe(parentWindow)+" "+x+"/"+y+" "+width+"x"+height);
@@ -1226,6 +1237,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
} finally {
windowLock.unlock();
}
+ sendWindowEvent(WindowEvent.EVENT_WINDOW_RESIZED); // trigger a resize/relayout and repaint to listener
}
}
@@ -1527,6 +1539,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
} finally {
windowLock.unlock();
}
+ sendWindowEvent(WindowEvent.EVENT_WINDOW_RESIZED); // trigger a resize/relayout and repaint to listener
}
}