Index: macosx/tkMacOSXWm.c ================================================================== --- macosx/tkMacOSXWm.c +++ macosx/tkMacOSXWm.c @@ -229,10 +229,23 @@ pointrect.size.height = 0; return [self convertRectFromScreen:pointrect].origin; } #endif +- (NSSize)windowWillResize:(NSWindow *)sender + toSize:(NSSize)frameSize +{ + NSRect currentFrame = [sender frame]; + TkWindow *winPtr = TkMacOSXGetTkWindow(sender); + if (winPtr->wmInfoPtr->flags & WM_WIDTH_NOT_RESIZABLE) { + frameSize.width = currentFrame.size.width; + } + if (winPtr->wmInfoPtr->flags & WM_HEIGHT_NOT_RESIZABLE) { + frameSize.height = currentFrame.size.height; + } + return frameSize; +} @end #pragma mark - @@ -6266,16 +6279,19 @@ [macWindow setShowsResizeIndicator: !!(newAttributes & kWindowResizableAttribute)]; [[macWindow standardWindowButton:NSWindowZoomButton] setEnabled:(newAttributes & kWindowResizableAttribute) && (newAttributes & kWindowFullZoomAttribute)]; - if (newAttributes & kWindowResizableAttribute) { - wmPtr->flags &= ~(WM_WIDTH_NOT_RESIZABLE | - WM_HEIGHT_NOT_RESIZABLE); + if (newAttributes & kWindowHorizontalZoomAttribute) { + wmPtr->flags &= ~(WM_WIDTH_NOT_RESIZABLE); + } else { + wmPtr->flags |= (WM_WIDTH_NOT_RESIZABLE); + } + if (newAttributes & kWindowVerticalZoomAttribute) { + wmPtr->flags &= ~(WM_HEIGHT_NOT_RESIZABLE); } else { - wmPtr->flags |= (WM_WIDTH_NOT_RESIZABLE | - WM_HEIGHT_NOT_RESIZABLE); + wmPtr->flags |= (WM_HEIGHT_NOT_RESIZABLE); } WmUpdateGeom(wmPtr, winPtr); } if ((changedAttributes & kWindowToolbarButtonAttribute) || initial) { [macWindow setShowsToolbarButton: Index: tests/wm.test ================================================================== --- tests/wm.test +++ tests/wm.test @@ -1240,17 +1240,19 @@ test wm-resizable-1.5 {usage} -returnCodes error -body { wm resizable .t 1 bad } -result {expected boolean value but got "bad"} test wm-resizable-2.1 {setting and reading values} { - wm resizable .t 0 1 + wm resizable .t 0 0 set result [wm resizable .t] + wm resizable .t 0 1 + lappend result [wm resizable .t] wm resizable .t 1 0 lappend result [wm resizable .t] wm resizable .t 1 1 lappend result [wm resizable .t] -} {0 1 {1 0} {1 1}} +} {0 0 {0 1} {1 0} {1 1}} ### wm sizefrom ### test wm-sizefrom-1.1 {usage} -returnCodes error -body { wm sizefrom