--- old/src/java.desktop/unix/classes/sun/awt/X11/XDecoratedPeer.java 2016-10-12 22:11:22.305019651 +0300 +++ new/src/java.desktop/unix/classes/sun/awt/X11/XDecoratedPeer.java 2016-10-12 22:11:22.165019656 +0300 @@ -301,7 +301,10 @@ } private void resetWMSetInsets() { - wm_set_insets = null; + if (XWM.getWMID() != XWM.UNITY_COMPIZ_WM) { + currentInsets = new Insets(0, 0, 0, 0); + wm_set_insets = null; + } } public void handlePropertyNotify(XEvent xev) { @@ -352,7 +355,7 @@ // and the initially guessed insets were wrong handleCorrectInsets(in); } - } else if (!dimensions.isClientSizeSet()) { + } else if (!insets_corrected || !dimensions.isClientSizeSet()) { insets_corrected = true; // initial insets were guessed correctly. Re-request // frame bounds because they may be changed by WM if the @@ -908,7 +911,6 @@ public void setResizable(boolean resizable) { int fs = winAttr.functions; if (!isResizable() && resizable) { - currentInsets = new Insets(0, 0, 0, 0); resetWMSetInsets(); if (!isEmbedded()) { setReparented(false); @@ -922,7 +924,6 @@ winAttr.functions = fs; XWM.setShellResizable(this); } else if (isResizable() && !resizable) { - currentInsets = new Insets(0, 0, 0, 0); resetWMSetInsets(); if (!isEmbedded()) { setReparented(false);