diff options
author | Sven Gothel <sgothel@jausoft.com> | 2011-09-15 05:41:49 +0200 |
---|---|---|
committer | Sven Gothel <sgothel@jausoft.com> | 2011-09-15 05:41:49 +0200 |
commit | 1b7844b9422472aa1c5089ed8c4918eb6ebcfd23 (patch) | |
tree | ba26e43df4dca6eb3fab841263f8f2cd5f2f4614 /src/newt | |
parent | 5986c56f506ebab1c26e3eb7f8130018d97bc202 (diff) |
NEWT/WindowImpl: Allow fullscreen at window creation
Diffstat (limited to 'src/newt')
-rw-r--r-- | src/newt/classes/jogamp/newt/WindowImpl.java | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java index 12534c951..bed81cd02 100644 --- a/src/newt/classes/jogamp/newt/WindowImpl.java +++ b/src/newt/classes/jogamp/newt/WindowImpl.java @@ -291,6 +291,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer } else { waitForAnyPos(false, TIMEOUT_NATIVEWINDOW); } + if(isFullscreen()) { + fullscreen = false; + FullScreenActionImpl fsa = new FullScreenActionImpl(true); + fsa.run(); + } } } // always flag visible, @@ -393,6 +398,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer * The native implementation must set the native windowHandle.<br> * * <p> + * The implementation shall respect the states {@link #isAlwaysOnTop()}/{@link #FLAG_IS_ALWAYSONTOP} and + * {@link #isUndecorated()}/{@link #FLAG_IS_UNDECORATED}, ie. the created window shall reflect those settings. + * </p> + * + * <p> * The implementation should invoke the referenced java state callbacks * to notify this Java object of state changes.</p> * @@ -1530,9 +1540,16 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer public final void run() { windowLock.lock(); try { - if(isNativeValid() && WindowImpl.this.fullscreen != fullscreen) { + if(WindowImpl.this.fullscreen != fullscreen) { + final boolean nativeFullscreenChange = isNativeValid() && + isFullscreen() != fullscreen ; + + // set current state + WindowImpl.this.fullscreen = fullscreen; + + if( nativeFullscreenChange ) { int x,y,w,h; - WindowImpl.this.fullscreen = fullscreen; + if(fullscreen) { nfs_x = WindowImpl.this.x; nfs_y = WindowImpl.this.y; @@ -1604,6 +1621,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer } } } + } } finally { windowLock.unlock(); } |