diff options
author | Sven Gothel <[email protected]> | 2011-09-07 02:09:23 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-09-07 02:09:23 +0200 |
commit | 6ff7ba18a549a3fef9fcb01a2944bd0907799864 (patch) | |
tree | ed3f5d8276b8038a614553df6ab714a835e9631f /src/newt | |
parent | 2a21725feb298462900c5f3af849e83a524fbddf (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/newt')
-rw-r--r-- | src/newt/classes/jogamp/newt/WindowImpl.java | 21 |
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 } } |