diff options
author | Sven Gothel <[email protected]> | 2012-03-10 03:54:12 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-03-10 03:54:12 +0100 |
commit | 3424091ecaa0d885ce7fd7c3a2279930cfd56040 (patch) | |
tree | 6371b5e44a2cd90bf6f04b149e6e2db78df5791c | |
parent | fdaf6846c571d890360dededf284ebccb166deba (diff) |
NEWT/setFullscreen(v): Save new state for to-be-created windows (not yet valid).
-rw-r--r-- | src/newt/classes/jogamp/newt/WindowImpl.java | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java index d7382e0ea..c73f72cfd 100644 --- a/src/newt/classes/jogamp/newt/WindowImpl.java +++ b/src/newt/classes/jogamp/newt/WindowImpl.java @@ -1702,17 +1702,19 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer private class FullScreenActionImpl implements Runnable { boolean fullscreen; - boolean nativeFullscreenChange; private FullScreenActionImpl() { } - public void init(boolean fullscreen) { - this.fullscreen = fullscreen; - this.nativeFullscreenChange = isNativeValid() && isFullscreen() != fullscreen ; + public boolean init(boolean fullscreen) { + if(isNativeValid()) { + this.fullscreen = fullscreen; + return isFullscreen() != fullscreen; + } else { + WindowImpl.this.fullscreen = fullscreen; // set current state for createNative(..) + return false; + } } - public boolean nativeFullscreenChange() { return nativeFullscreenChange; } - public boolean nativeFullscreenOn() { return nativeFullscreenChange && fullscreen; } - public boolean nativeFullscreenOff() { return nativeFullscreenChange && !fullscreen; } + public boolean fsOn() { return fullscreen; } public final void run() { windowLock.lock(); @@ -1801,9 +1803,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer public boolean setFullscreen(boolean fullscreen) { synchronized(fullScreenAction) { - fullScreenAction.init(fullscreen); - if( fullScreenAction.nativeFullscreenChange() ) { - if(fullScreenAction.nativeFullscreenOn() && + if( fullScreenAction.init(fullscreen) ) { + if(fullScreenAction.fsOn() && isOffscreenInstance(WindowImpl.this, parentWindow)) { // enable fullscreen on offscreen instance if(null != parentWindow) { @@ -1816,7 +1817,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer runOnEDTIfAvail(true, fullScreenAction); - if(fullScreenAction.nativeFullscreenOff() && null != nfs_parent) { + if(!fullScreenAction.fsOn() && null != nfs_parent) { // disable fullscreen on offscreen instance reparentWindow(nfs_parent, true); nfs_parent = null; |