diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/newt/classes/jogamp/newt/OffscreenWindow.java | 23 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/WindowImpl.java | 10 |
2 files changed, 24 insertions, 9 deletions
diff --git a/src/newt/classes/jogamp/newt/OffscreenWindow.java b/src/newt/classes/jogamp/newt/OffscreenWindow.java index fa7bafe5b..a7a930691 100644 --- a/src/newt/classes/jogamp/newt/OffscreenWindow.java +++ b/src/newt/classes/jogamp/newt/OffscreenWindow.java @@ -48,9 +48,6 @@ public class OffscreenWindow extends WindowImpl implements SurfaceChangeable { static long nextWindowHandle = 0x100; // start here - a marker protected void createNativeImpl() { - if(0!=getParentWindowHandle()) { - throw new NativeWindowException("OffscreenWindow does not support window parenting"); - } if(capsRequested.isOnscreen()) { throw new NativeWindowException("Capabilities is onscreen"); } @@ -90,28 +87,36 @@ public class OffscreenWindow extends WindowImpl implements SurfaceChangeable { @Override public void setSize(int width, int height) { - if(!isVisible()) { - sizeChanged(false, width, height, false); + if(!isNativeValid()) { + super.setSize(width, height); } } + @Override public void setPosition(int x, int y) { // nop } + @Override public boolean setFullscreen(boolean fullscreen) { // nop return false; } - + protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) { if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) ) { sizeChanged(false, width, height, false); - visibleChanged(false, 0 != ( FLAG_IS_VISIBLE & flags)); + visibleChanged(false, 0 != ( FLAG_IS_VISIBLE & flags)); } else { - shouldNotCallThis(); + /** + * silently ignore: + FLAG_CHANGE_PARENTING + FLAG_CHANGE_DECORATION + FLAG_CHANGE_FULLSCREEN + FLAG_CHANGE_ALWAYSONTOP + */ } - return false; + return true; } @Override diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java index aadb89679..919c32f13 100644 --- a/src/newt/classes/jogamp/newt/WindowImpl.java +++ b/src/newt/classes/jogamp/newt/WindowImpl.java @@ -538,6 +538,10 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer // NativeSurface // + public NativeSurface getNativeSurface() { + return this; + } + public final int lockSurface() { windowLock.lock(); surfaceLock.lock(); @@ -630,6 +634,10 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer // NativeWindow // + public NativeWindow getNativeWindow() { + return this; + } + // public final void destroy() - see below public final NativeWindow getParent() { @@ -930,6 +938,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer private void setScreen(ScreenImpl newScreen) { // never null ! WindowImpl.this.removeScreenReference(); screen = newScreen; + screen.addReference(); + screenReferenceAdded = false; } public final void run() { |