diff options
Diffstat (limited to 'macosx/tkMacOSXWm.c')
-rw-r--r-- | macosx/tkMacOSXWm.c | 43 |
1 files changed, 32 insertions, 11 deletions
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index cb5d49b..9b05ad6 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXWm.c,v 1.50 2007/05/30 06:35:55 das Exp $ + * RCS: @(#) $Id: tkMacOSXWm.c,v 1.51 2007/05/31 13:38:17 das Exp $ */ #include "tkMacOSXInt.h" @@ -894,7 +894,7 @@ static int WmSetAttribute( wmPtr->macClass, oldAttributes, 1); ChkErr(ReshapeCustomWindow, macWindow); TkMacOSXInvalidateWindow((MacDrawable *)(winPtr->window), - TK_WINDOW_ONLY); + TK_PARENT_WINDOW); } break; case _WMATT_LAST_ATTRIBUTE: @@ -4511,6 +4511,7 @@ TkMacOSXGrowToplevel( if (wmPtr->gridWin != NULL) { int base = winPtr->reqWidth - (wmPtr->reqGridWidth * wmPtr->widthInc); + if (base < 0) { base = 0; } @@ -4696,6 +4697,19 @@ TkMacOSXIsWindowZoomed( return false; } GetMaxSize(winPtr, &maxWidth, &maxHeight); + if (wmPtr->gridWin != NULL) { + int base = winPtr->reqWidth - (wmPtr->reqGridWidth * wmPtr->widthInc); + + if (base < 0) { + base = 0; + } + maxWidth = base + (maxWidth * wmPtr->widthInc); + base = winPtr->reqHeight - (wmPtr->reqGridHeight * wmPtr->heightInc); + if (base < 0) { + base = 0; + } + maxHeight = base + (maxHeight * wmPtr->heightInc); + } if (wmPtr->flags & WM_WIDTH_NOT_RESIZABLE) { idealSize.h = winPtr->changes.width; } else { @@ -4743,9 +4757,7 @@ TkMacOSXZoomToplevel( WmInfo *wmPtr; Point idealSize; int maxWidth, maxHeight; - Rect portRect; OSStatus err; - CGrafPtr destPort = GetWindowPort(whichWindow); window = TkMacOSXGetXWindow(whichWindow); dispPtr = TkGetDisplayList(); @@ -4757,6 +4769,19 @@ TkMacOSXZoomToplevel( return false; } GetMaxSize(winPtr, &maxWidth, &maxHeight); + if (wmPtr->gridWin != NULL) { + int base = winPtr->reqWidth - (wmPtr->reqGridWidth * wmPtr->widthInc); + + if (base < 0) { + base = 0; + } + maxWidth = base + (maxWidth * wmPtr->widthInc); + base = winPtr->reqHeight - (wmPtr->reqGridHeight * wmPtr->heightInc); + if (base < 0) { + base = 0; + } + maxHeight = base + (maxHeight * wmPtr->heightInc); + } if (wmPtr->flags & WM_WIDTH_NOT_RESIZABLE) { idealSize.h = winPtr->changes.width; } else { @@ -4774,12 +4799,10 @@ TkMacOSXZoomToplevel( return false; } - GetPortBounds(destPort, &portRect); err = ChkErr(ZoomWindowIdeal, whichWindow, zoomPart, &idealSize); if (err == noErr) { wmPtr->hints.initial_state = (zoomPart == inZoomIn ? NormalState : ZoomState); - InvalWindowRect(whichWindow, &portRect); return true; } else { return false; @@ -5841,7 +5864,7 @@ ApplyWindowClassAttributeChanges( #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 if (wmPtr->macClass != oldClass #if MAC_OS_X_VERSION_MIN_REQUIRED < 1030 - && HIWindowChangeClass != NULL + && HIWindowChangeClass != NULL #endif ) { ChkErr(HIWindowChangeClass, macWindow, wmPtr->macClass); @@ -5865,6 +5888,8 @@ ApplyWindowClassAttributeChanges( ChkErr(HIGrowBoxViewSetTransparent, growBoxView, true); } } + TkMacOSXInvalidateWindow((MacDrawable *)(winPtr->window), + TK_PARENT_WINDOW); } /* @@ -6012,8 +6037,6 @@ TkMacOSXMakeFullscreen( ChkErr(SetWindowBounds, window, kWindowContentRgn, &screenBounds); wmPtr->flags &= ~WM_SYNC_PENDING; - TkMacOSXInvalidateWindow((MacDrawable*)winPtr->window, - TK_WINDOW_ONLY); } wmPtr->flags |= WM_FULLSCREEN; } @@ -6033,8 +6056,6 @@ TkMacOSXMakeFullscreen( wmPtr->flags |= WM_SYNC_PENDING; ChkErr(SetWindowBounds, window, kWindowStructureRgn, &bounds); wmPtr->flags &= ~WM_SYNC_PENDING; - TkMacOSXInvalidateWindow((MacDrawable*)winPtr->window, - TK_WINDOW_ONLY); } TkMacOSXEnterExitFullscreen(winPtr, IsWindowActive(window)); return result; |