--- tk/unix/tkUnixWm.c	2010-07-07 02:04:29.000000000 +0200
+++ tk/unix/tkUnixWm.c.mod	2010-07-07 02:04:25.000000000 +0200
@@ -1518,6 +1518,11 @@
 	wmPtr->maxWidth = width;
 	wmPtr->maxHeight = height;
 	wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
+	if (width <= 0 && height <= 0) {
+	    wmPtr->sizeHintsFlags &= ~PMaxSize;
+	} else {
+	    wmPtr->sizeHintsFlags |= PMaxSize;
+	}
 	goto updateGeom;
     } else if ((c == 'm') && (strncmp(argv[1], "minsize", length) == 0)
 	    && (length >= 2)) {
@@ -2993,7 +2998,7 @@
     hintsPtr->max_aspect.x = wmPtr->maxAspect.x;
     hintsPtr->max_aspect.y = wmPtr->maxAspect.y;
     hintsPtr->win_gravity = wmPtr->gravity;
-    hintsPtr->flags = wmPtr->sizeHintsFlags | PMinSize | PMaxSize;
+    hintsPtr->flags = wmPtr->sizeHintsFlags | PMinSize;
 
     /*
      * If the window isn't supposed to be resizable, then set the
