diff options
Diffstat (limited to 'src')
6 files changed, 32 insertions, 19 deletions
diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java index 491f984f2..ee6072ae9 100644 --- a/src/newt/classes/jogamp/newt/WindowImpl.java +++ b/src/newt/classes/jogamp/newt/WindowImpl.java @@ -378,7 +378,9 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer sb.append(", "); } - if( 0 == ( ( STATE_MASK_POINTERVISIBLE | STATE_MASK_POINTERCONFINED ) & mask) ) { + if( 0 == ( STATE_MASK_POINTERVISIBLE & mask) || + 0 != ( STATE_MASK_POINTERCONFINED & mask) ) + { sb.append("pointer["); if( 0 == ( STATE_MASK_POINTERVISIBLE & mask) ) { sb.append("invisible"); @@ -1131,7 +1133,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer stateMask.set(STATE_BIT_VISIBLE); } else if(stateMask.get(STATE_BIT_VISIBLE) != visible) { if(isNativeValid()) { - setVisibleImpl(visible /* visible */, false /* fast */, getX(), getY(), getWidth(), getHeight()); + // Skip WM if child-window! + setVisibleImpl(visible /* visible */, isChildWindow() /* fast */, getX(), getY(), getWidth(), getHeight()); WindowImpl.this.waitForVisible(visible, false); madeVisible = visible; } else { diff --git a/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java index deaba5f0c..76c46d93d 100644 --- a/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java @@ -413,18 +413,18 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl final NativeWindow pWin = getParent(); final AbstractGraphicsConfiguration pWinCfg = null != pWin ? pWin.getGraphicsConfiguration() : null; System.err.println("MacWindow reconfig.0: "+x+"/"+y+" -> clientPos "+pClientLevelOnSreen+" - "+width+"x"+height+ + ", "+getStateMaskString()+" -> "+getReconfigStateMaskString(flags)+ ",\n\t parent type "+(null != pWin ? pWin.getClass().getName() : null)+ ",\n\t this-chosenCaps "+(null != cWinCfg ? cWinCfg.getChosenCapabilities() : null)+ ",\n\t parent-chosenCaps "+(null != pWinCfg ? pWinCfg.getChosenCapabilities() : null)+ ", isOffscreenInstance(sscSurfaceHandle "+toHexString(sscSurfaceHandle)+ ", ioi: "+_isOffscreenInstance+ - ") -> "+isOffscreenInstance+ - "\n\t, "+getReconfigStateMaskString(flags)); + ") -> "+isOffscreenInstance); // Thread.dumpStack(); } if( 0 != ( CHANGE_MASK_VISIBILITY & flags) && - 0 != ( STATE_MASK_VISIBLE & flags) ) + 0 == ( STATE_MASK_VISIBLE & flags) ) { if ( !isOffscreenInstance ) { OSXUtil.RunOnMainThread(false, false, new Runnable() { @@ -490,7 +490,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl } } if(DEBUG_IMPLEMENTATION) { - System.err.println("MacWindow reconfig.X: clientPos "+pClientLevelOnSreen+", "+width+"x"+height+" -> clientPos "+getLocationOnScreenImpl(0, 0)+", insets: "+getInsets()); + System.err.println("MaxWindow reconfig.X: "+getLocationOnScreenImpl(0, 0)+" "+getWidth()+"x"+getHeight()+", insets "+getInsets()+", "+getStateMaskString()); } return true; } @@ -704,10 +704,10 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl if( 0 != ( STATE_MASK_UNDECORATED & flags) || offscreenInstance ) { ws = NSBorderlessWindowMask; } else { - ws = NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask|NSResizableWindowMask; - } - if( 0 != ( STATE_MASK_RESIZABLE & flags) ) { - ws |= NSResizableWindowMask; + ws = NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask; + if( 0 != ( STATE_MASK_RESIZABLE & flags) ) { + ws |= NSResizableWindowMask; + } } windowStyle = ws; } diff --git a/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java index 83604a380..1b387f53c 100644 --- a/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java @@ -190,8 +190,8 @@ public class WindowDriver extends WindowImpl { @Override protected boolean reconfigureWindowImpl(int x, int y, int width, int height, final int flags) { if(DEBUG_IMPLEMENTATION) { - System.err.println("WindowsWindow reconfig: "+x+"/"+y+" "+width+"x"+height+", "+ - getReconfigStateMaskString(flags)); + System.err.println("WindowsWindow reconfig.0: "+x+"/"+y+" "+width+"x"+height+ + ", "+getStateMaskString()+" -> "+getReconfigStateMaskString(flags)); } if(0 == ( STATE_MASK_UNDECORATED & flags)) { @@ -212,6 +212,9 @@ public class WindowDriver extends WindowImpl { if( 0 != ( CHANGE_MASK_VISIBILITY & flags) ) { visibleChanged(false, 0 != ( STATE_MASK_VISIBLE & flags)); } + if(DEBUG_IMPLEMENTATION) { + System.err.println("WindowsWindow reconfig.X: "+getX()+"/"+getY()+" "+getWidth()+"x"+getHeight()+", "+getStateMaskString()); + } return true; } diff --git a/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java index fb2a593bc..6d1326a6d 100644 --- a/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java @@ -195,7 +195,8 @@ public class WindowDriver extends WindowImpl { _y = y; } if(DEBUG_IMPLEMENTATION) { - System.err.println("X11Window reconfig: "+x+"/"+y+" -> "+_x+"/"+_y+" "+width+"x"+height+", insets "+_insets+", "+ getReconfigStateMaskString(flags)); + System.err.println("X11Window reconfig.0: "+x+"/"+y+" -> "+_x+"/"+_y+" "+width+"x"+height+", insets "+_insets+ + ", "+getStateMaskString()+" -> "+getReconfigStateMaskString(flags)); } if( 0 != ( CHANGE_MASK_FULLSCREEN & flags ) ) { if( 0 != ( STATE_MASK_FULLSCREEN & flags) && @@ -219,6 +220,9 @@ public class WindowDriver extends WindowImpl { return null; } }); + if(DEBUG_IMPLEMENTATION) { + System.err.println("X11Window reconfig.X: "+getX()+"/"+getY()+" "+getWidth()+"x"+getHeight()+", insets "+getInsets()+", "+getStateMaskString()); + } return true; } volatile boolean tempFSAlwaysOnTop = false; diff --git a/src/newt/native/X11Window.c b/src/newt/native/X11Window.c index ca768240f..778b71cc5 100644 --- a/src/newt/native/X11Window.c +++ b/src/newt/native/X11Window.c @@ -689,9 +689,11 @@ static Bool WaitForUnmapNotify( Display *dpy, XEvent *event, XPointer arg ) { return (event->type == UnmapNotify) && (event->xmap.window == (Window) arg); } -static void NewtWindows_setVisible(Display *dpy, Window root, JavaWindow* jw, Bool visible, Bool useWM, Bool waitForMapNotify) { +static void NewtWindows_setVisible(Display *dpy, Window root, JavaWindow* jw, Bool visible, Bool useWM, Bool waitForNotify) { XEvent event; if( !visible && useWM && 0 != ( _MASK_NET_WM_STATE_HIDDEN & jw->supportedAtoms ) ) { + DBG_PRINT( "X11: setVisible -> %d, method: IconicState, wait %d, window %p\n", (int)visible, (int)waitForNotify, (void*)jw->window); + // It has been experienced that UnmapNotify is not sent for child windows when using IconicState! XEvent xev; memset ( &xev, 0, sizeof(xev) ); xev.type = ClientMessage; @@ -701,18 +703,19 @@ static void NewtWindows_setVisible(Display *dpy, Window root, JavaWindow* jw, Bo xev.xclient.data.l[0] = IconicState; XSendEvent ( dpy, root, False, SubstructureNotifyMask | SubstructureRedirectMask, &xev ); // NewtWindows_sendNET_WM_STATE(dpy, root, jw, _NET_WM_STATE_HIDDEN_IDX, 0, !visible); - if(waitForMapNotify) { + if(waitForNotify) { XIfEvent( dpy, &event, WaitForUnmapNotify, (XPointer) jw->window ); } } else { + DBG_PRINT( "X11: setVisible -> %d, method: Map/Unmap, wait %d, window %p\n", (int)visible, (int)waitForNotify, (void*)jw->window); if( visible ) { XMapRaised(dpy, jw->window); - if(waitForMapNotify) { + if(waitForNotify) { XIfEvent( dpy, &event, WaitForMapNotify, (XPointer) jw->window ); } } else { XUnmapWindow(dpy, jw->window); - if(waitForMapNotify) { + if(waitForNotify) { XIfEvent( dpy, &event, WaitForUnmapNotify, (XPointer) jw->window ); } } @@ -1193,7 +1196,7 @@ JNIEXPORT void JNICALL Java_jogamp_newt_driver_x11_WindowDriver_reconfigureWindo NewtWindows_setVisible(dpy, root, jw, True /* visible */, False /* useWM */, True /* wait */); // no need to notify the java side .. just temp change } else if( TST_FLAG_CHANGE_VISIBILITY(flags) ) { - Bool useWM = TST_FLAG_CHANGE_VISIBILITY_FAST(flags) ? False : True; + Bool useWM = ( TST_FLAG_CHANGE_VISIBILITY_FAST(flags) || TST_FLAG_IS_CHILD(flags) ) ? False : True; if( TST_FLAG_IS_VISIBLE(flags) ) { DBG_PRINT( "X11: reconfigureWindow0 VISIBLE ON\n"); NewtWindows_setVisible(dpy, root, jw, True /* visible */, useWM, False /* wait */); diff --git a/src/test/com/jogamp/opengl/test/junit/util/NEWTDemoListener.java b/src/test/com/jogamp/opengl/test/junit/util/NEWTDemoListener.java index 33479569e..b70beae69 100644 --- a/src/test/com/jogamp/opengl/test/junit/util/NEWTDemoListener.java +++ b/src/test/com/jogamp/opengl/test/junit/util/NEWTDemoListener.java @@ -300,7 +300,7 @@ public class NEWTDemoListener extends MouseAdapter implements KeyListener { printlnState("[set visible post]"); glWindow.setExclusiveContextThread(t); } - if( wasVisible ) { + if( wasVisible && !e.isControlDown() ) { try { Thread.sleep(5000); } catch (final InterruptedException e) { |