From 51f84125beb4ac50fedab9fe691225b234b12bc6 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 6 Oct 2011 05:50:55 +0200 Subject: NEWT/Window/setVisible: Remove setVisible(..) fast path - Always set visible=true, even if size==0 We need to earmark visible=true in case the native window could not be created, even if the size is currently 0. --- src/newt/classes/jogamp/newt/WindowImpl.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 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 f2012215e..00911443a 100644 --- a/src/newt/classes/jogamp/newt/WindowImpl.java +++ b/src/newt/classes/jogamp/newt/WindowImpl.java @@ -288,9 +288,6 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer } } } - // always flag visible, - // allowing to retry if visible && !isNativeValid() - visible = true; } } finally { if(null!=parentWindow) { @@ -699,6 +696,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer nativeWindowCreated = createNative(); madeVisible = nativeWindowCreated; } + // always flag visible, allowing a retry .. + WindowImpl.this.visible = true; } else if(WindowImpl.this.visible != visible) { if(isNativeValid()) { setVisibleImpl(visible, x, y, width, height); @@ -745,11 +744,6 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer } public void setVisible(boolean visible) { - if( !isNativeValid() && visible && 0>=width*height ) { - // fast-path: not realized yet, make visible, but zero size - return; - } - if(DEBUG_IMPLEMENTATION) { System.err.println("Window setVisible: START ("+getThreadName()+") "+x+"/"+y+" "+width+"x"+height+", fs "+fullscreen+", windowHandle "+toHexString(windowHandle)+", visible: "+this.visible+" -> "+visible+", parentWindowHandle "+toHexString(parentWindowHandle)+", parentWindow "+(null!=parentWindow)); Thread.dumpStack(); -- cgit v1.2.3