From 1b7844b9422472aa1c5089ed8c4918eb6ebcfd23 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 15 Sep 2011 05:41:49 +0200 Subject: NEWT/WindowImpl: Allow fullscreen at window creation --- src/newt/classes/jogamp/newt/WindowImpl.java | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'src/newt/classes/jogamp') 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.
* *

+ * 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. + *

+ * + *

* The implementation should invoke the referenced java state callbacks * to notify this Java object of state changes.

* @@ -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(); } -- cgit v1.2.3