1012 /* 1013 * Do the re/mapping at the Xlib level. Since we essentially 1014 * work around a WM bug we don't want this hack to be exposed 1015 * to Intrinsics (i.e. don't mess with grabs, callbacks etc). 1016 */ 1017 window.xSetVisible(false); 1018 XToolkit.XSync(); 1019 window.xSetVisible(true); 1020 } 1021 } 1022 1023 /* 1024 * Make specified shell resizable. 1025 */ 1026 static void setShellResizable(XDecoratedPeer window) { 1027 if (insLog.isLoggable(PlatformLogger.Level.FINE)) { 1028 insLog.fine("Setting shell resizable " + window); 1029 } 1030 XToolkit.awtLock(); 1031 try { 1032 Rectangle shellBounds = window.getShellBounds(); 1033 shellBounds.translate(-window.currentInsets.left, -window.currentInsets.top); 1034 window.updateSizeHints(window.getDimensions()); 1035 requestWMExtents(window.getWindow()); 1036 XlibWrapper.XMoveResizeWindow(XToolkit.getDisplay(), 1037 window.getShell(), 1038 window.scaleUp(shellBounds.x), 1039 window.scaleUp(shellBounds.y), 1040 window.scaleUp(shellBounds.width), 1041 window.scaleUp(shellBounds.height)); 1042 /* REMINDER: will need to revisit when setExtendedStateBounds is added */ 1043 //Fix for 4320050: Minimum size for java.awt.Frame is not being enforced. 1044 //We need to update frame's minimum size, not to reset it 1045 removeSizeHints(window, XUtilConstants.PMaxSize); 1046 window.updateMinimumSize(); 1047 1048 /* Restore decorations */ 1049 setShellDecor(window); 1050 } finally { 1051 XToolkit.awtUnlock(); 1052 } 1053 } | 1012 /* 1013 * Do the re/mapping at the Xlib level. Since we essentially 1014 * work around a WM bug we don't want this hack to be exposed 1015 * to Intrinsics (i.e. don't mess with grabs, callbacks etc). 1016 */ 1017 window.xSetVisible(false); 1018 XToolkit.XSync(); 1019 window.xSetVisible(true); 1020 } 1021 } 1022 1023 /* 1024 * Make specified shell resizable. 1025 */ 1026 static void setShellResizable(XDecoratedPeer window) { 1027 if (insLog.isLoggable(PlatformLogger.Level.FINE)) { 1028 insLog.fine("Setting shell resizable " + window); 1029 } 1030 XToolkit.awtLock(); 1031 try { 1032 Rectangle shellBounds; 1033 if (getWMID() != UNITY_COMPIZ_WM) { 1034 shellBounds = window.getShellBounds(); 1035 shellBounds.translate(-window.currentInsets.left, 1036 -window.currentInsets.top); 1037 } else { 1038 shellBounds = window.getDimensions().getScreenBounds(); 1039 } 1040 window.updateSizeHints(window.getDimensions()); 1041 requestWMExtents(window.getWindow()); 1042 XlibWrapper.XMoveResizeWindow(XToolkit.getDisplay(), 1043 window.getShell(), 1044 window.scaleUp(shellBounds.x), 1045 window.scaleUp(shellBounds.y), 1046 window.scaleUp(shellBounds.width), 1047 window.scaleUp(shellBounds.height)); 1048 /* REMINDER: will need to revisit when setExtendedStateBounds is added */ 1049 //Fix for 4320050: Minimum size for java.awt.Frame is not being enforced. 1050 //We need to update frame's minimum size, not to reset it 1051 removeSizeHints(window, XUtilConstants.PMaxSize); 1052 window.updateMinimumSize(); 1053 1054 /* Restore decorations */ 1055 setShellDecor(window); 1056 } finally { 1057 XToolkit.awtUnlock(); 1058 } 1059 } |