--- old/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java 2015-10-01 13:14:12.000000000 +0300 +++ new/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java 2015-10-01 13:14:12.000000000 +0300 @@ -1055,13 +1055,23 @@ log.fine("Promoting always-on-top state {0}", Boolean.valueOf(alwaysOnTop)); } XWM.getWM().setLayer(this, - alwaysOnTop ? - XLayerProtocol.LAYER_ALWAYS_ON_TOP : - XLayerProtocol.LAYER_NORMAL); + alwaysOnTop ? + XLayerProtocol.LAYER_ALWAYS_ON_TOP : + XLayerProtocol.LAYER_NORMAL); } public void updateAlwaysOnTopState() { this.alwaysOnTop = ((Window) this.target).isAlwaysOnTop(); + if (ownerPeer != null) { + XToolkit.awtLock(); + try { + applyWindowType(); + restoreTransientFor(this); + } + finally { + XToolkit.awtUnlock(); + } + } updateAlwaysOnTop(); } @@ -1647,6 +1657,11 @@ while (!XlibUtil.isToplevelWindow(bpw) && !XlibUtil.isXAWTToplevelWindow(bpw)) { bpw = XlibUtil.getParentWindow(bpw); } + if (!transientForWindow.isVisible()) { + XlibWrapper.XSetTransientFor(XToolkit.getDisplay(), bpw, XToolkit.getDefaultRootWindow()); + window.curRealTransientFor = null; + return; + } long tpw = transientForWindow.getWindow(); while (!XlibUtil.isToplevelWindow(tpw) && !XlibUtil.isXAWTToplevelWindow(tpw)) { tpw = XlibUtil.getParentWindow(tpw); @@ -1946,7 +1961,7 @@ switch (getWindowType()) { case NORMAL: - typeAtom = (ownerPeer == null) ? + typeAtom = ownerPeer == null || !ownerPeer.isVisible() ? protocol.XA_NET_WM_WINDOW_TYPE_NORMAL : protocol.XA_NET_WM_WINDOW_TYPE_DIALOG; break;