diff options
author | Sven Gothel <[email protected]> | 2013-12-20 08:49:05 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-12-20 08:49:05 +0100 |
commit | 904adbe63a806ff73ea654da6cc964277bbbb8d3 (patch) | |
tree | cede13eba527f65a8aaab9ce87577d8e94de903f | |
parent | d67a2c52167abfd2d15e1b2b7c8a5d810932f398 (diff) |
Bug 924: Make ALWAYS_ON_TOP Persistent when Reparenting (child -> top) (2nd attempt)
Commit c8726ef04b94ad8e66e1191a06ff793b908d130c reinforced ALWAYS_ON_TOP in native reconfig code
issued at reparenting call, which might be too early for the WM.
Perform ALWAYS_ON_TOP reinforcement from java side when reparenting CHILD -> TOP was successful
and visibility is reached. X11 only!
NewtAWTReparentingKeyAdapter: Add 'a' alwaysOnTop toggle to test w/o applet code.
-rw-r--r-- | make/scripts/tests.sh | 2 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/WindowImpl.java | 4 | ||||
-rw-r--r-- | src/newt/native/X11Window.c | 4 | ||||
-rw-r--r-- | src/test/com/jogamp/opengl/test/junit/newt/parenting/NewtAWTReparentingKeyAdapter.java | 6 |
4 files changed, 11 insertions, 5 deletions
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh index b680d2b25..57b13ab3b 100644 --- a/make/scripts/tests.sh +++ b/make/scripts/tests.sh @@ -93,7 +93,7 @@ function jrun() { #D_ARGS="-Djogl.debug=all -Dnativewindow.debug=all" #D_ARGS="-Djogamp.debug=all -Dnativewindow.debug=all -Djogl.debug=all -Dnewt.debug=all" #D_ARGS="-Dnativewindow.debug=all -Djogl.debug=all -Dnewt.debug=all" - D_ARGS="-Dnativewindow.debug=all -Dnewt.debug=all" + D_ARGS="-Dnativewindow.debug=all -Dnewt.debug.Window" #D_ARGS="-Djogl.debug=all -Dnativewindow.debug=all -Dnewt.debug=all -Djogamp.debug.Lock" #D_ARGS="-Dnativewindow.debug.X11Util.ATI_HAS_NO_XCLOSEDISPLAY_BUG" diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java index 437179f12..d63104c71 100644 --- a/src/newt/classes/jogamp/newt/WindowImpl.java +++ b/src/newt/classes/jogamp/newt/WindowImpl.java @@ -1440,6 +1440,10 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer setVisibleImpl(true, x, y, width, height); ok = 0 <= WindowImpl.this.waitForVisible(true, false); if(ok) { + if( isAlwaysOnTop() && 0 == parentWindowHandle && NativeWindowFactory.TYPE_X11 == NativeWindowFactory.getNativeWindowType(true) ) { + // Reinforce ALWAYSONTOP when CHILD -> TOP reparenting, since reparenting itself cause X11 WM to loose it's state. + reconfigureWindowImpl(x, y, width, height, getReconfigureFlags(FLAG_CHANGE_ALWAYSONTOP, isVisible())); + } ok = WindowImpl.this.waitForSize(width, height, false, TIMEOUT_NATIVEWINDOW); } if(ok) { diff --git a/src/newt/native/X11Window.c b/src/newt/native/X11Window.c index ad17f970b..5f5dddbe0 100644 --- a/src/newt/native/X11Window.c +++ b/src/newt/native/X11Window.c @@ -822,10 +822,6 @@ JNIEXPORT void JNICALL Java_jogamp_newt_driver_x11_WindowDriver_reconfigureWindo XSetWMProtocols(dpy, w, &wm_delete_atom, 1); // windowDeleteAtom // Fix for Unity WM, i.e. _remove_ persistent previous states NewtWindows_setStackingEWMHFlags(dpy, root, w, fsEWMHFlags, isVisible, False); - if( TST_FLAG_IS_ALWAYSONTOP(flags) ) { - // Reinforce always-on-top, lost by WM during reparenting - NewtWindows_setStackingEWMHFlags(dpy, root, w, _NET_WM_STATE_FLAG_ABOVE, isVisible, True); - } } if( TST_FLAG_CHANGE_DECORATION(flags) ) { diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/NewtAWTReparentingKeyAdapter.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/NewtAWTReparentingKeyAdapter.java index f7fbc7332..189645d3d 100644 --- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/NewtAWTReparentingKeyAdapter.java +++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/NewtAWTReparentingKeyAdapter.java @@ -96,6 +96,12 @@ public class NewtAWTReparentingKeyAdapter extends KeyAdapter { } } }.run(); + } else if( e.getKeySymbol() == KeyEvent.VK_A ) { + new Thread() { + public void run() { + glWindow.setAlwaysOnTop(!glWindow.isAlwaysOnTop()); + } + }.run(); } else if( e.getKeySymbol() == KeyEvent.VK_R ) { if( null != quitAdapter ) { quitAdapter.enable(false); |