src/solaris/classes/sun/awt/X11/XWM.java

Print this page

        

*** 974,985 **** try { Rectangle shellBounds = window.getShellBounds(); shellBounds.translate(-window.currentInsets.left, -window.currentInsets.top); window.updateSizeHints(window.getDimensions()); requestWMExtents(window.getWindow()); XlibWrapper.XMoveResizeWindow(XToolkit.getDisplay(), window.getShell(), ! shellBounds.x, shellBounds.y, shellBounds.width, shellBounds.height); /* REMINDER: will need to revisit when setExtendedStateBounds is added */ //Fix for 4320050: Minimum size for java.awt.Frame is not being enforced. //We need to update frame's minimum size, not to reset it removeSizeHints(window, PMaxSize); window.updateMinimumSize(); --- 974,993 ---- try { Rectangle shellBounds = window.getShellBounds(); shellBounds.translate(-window.currentInsets.left, -window.currentInsets.top); window.updateSizeHints(window.getDimensions()); requestWMExtents(window.getWindow()); + /* X does not allow setting heights or widths to 0: this will cause a BadValue + * error. Lets set them to something close enough */ + int width = shellBounds.width; + if (width <= 0) + width = 1; + int height = shellBounds.height; + if (height <= 0) + height = 1; XlibWrapper.XMoveResizeWindow(XToolkit.getDisplay(), window.getShell(), ! shellBounds.x, shellBounds.y, width, height); /* REMINDER: will need to revisit when setExtendedStateBounds is added */ //Fix for 4320050: Minimum size for java.awt.Frame is not being enforced. //We need to update frame's minimum size, not to reset it removeSizeHints(window, PMaxSize); window.updateMinimumSize();
*** 1006,1015 **** --- 1014,1031 ---- /* Fix min/max size hints at the specified values */ if (!shellBounds.isEmpty()) { window.updateSizeHints(newDimensions); requestWMExtents(window.getWindow()); XToolkit.XSync(); + /* X does not allow setting heights or widths to 0: this will cause a BadValue + * error. Lets set them to something close enough */ + int width = shellBounds.width; + if (width <= 0) + width = 1; + int height = shellBounds.height; + if (height <= 0) + height = 1; XlibWrapper.XMoveResizeWindow(XToolkit.getDisplay(), window.getShell(), shellBounds.x, shellBounds.y, shellBounds.width, shellBounds.height); } if (!justChangeSize) { /* update decorations */ setShellDecor(window);