Attachment "width_height.patch" to
ticket [568861ff]
added by
mdejong
2002-06-15 05:12:45.
Index: unix/tkUnixWm.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/unix/tkUnixWm.c,v
retrieving revision 1.21
diff -u -r1.21 tkUnixWm.c
--- unix/tkUnixWm.c 12 Jun 2002 19:02:49 -0000 1.21
+++ unix/tkUnixWm.c 14 Jun 2002 22:04:50 -0000
@@ -3031,7 +3078,7 @@
wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
}
if (wmPtr->flags & WM_UPDATE_SIZE_HINTS) {
- UpdateSizeHints(winPtr);
+ UpdateSizeHints(winPtr, width, height);
}
/*
@@ -3165,8 +3212,10 @@
*/
static void
-UpdateSizeHints(winPtr)
+UpdateSizeHints(winPtr, newWidth, newHeight)
TkWindow *winPtr;
+ int newWidth;
+ int newHeight;
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
XSizeHints *hintsPtr;
@@ -3228,20 +3277,11 @@
*/
if (wmPtr->flags & WM_WIDTH_NOT_RESIZABLE) {
- if (wmPtr->width >= 0) {
- hintsPtr->min_width = wmPtr->width;
- } else {
- hintsPtr->min_width = winPtr->reqWidth;
- }
- hintsPtr->max_width = hintsPtr->min_width;
+ hintsPtr->max_width = hintsPtr->min_width = newWidth;
}
if (wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE) {
- if (wmPtr->height >= 0) {
- hintsPtr->min_height = wmPtr->height;
- } else {
- hintsPtr->min_height = winPtr->reqHeight + wmPtr->menuHeight;
- }
- hintsPtr->max_height = hintsPtr->min_height;
+ hintsPtr->max_height = hintsPtr->min_height =
+ newHeight + wmPtr->menuHeight;
}