--- old/src/solaris/classes/sun/awt/X11/XWM.java 2010-09-24 09:45:33.041001088 -0400 +++ new/src/solaris/classes/sun/awt/X11/XWM.java 2010-09-24 09:45:32.712376916 -0400 @@ -976,8 +976,16 @@ 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, shellBounds.width, shellBounds.height); + 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 @@ -1008,6 +1016,14 @@ 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); }