diff options
author | das <das> | 2007-05-31 13:42:11 (GMT) |
---|---|---|
committer | das <das> | 2007-05-31 13:42:11 (GMT) |
commit | b2961e1a86c13f6505e843476369d46550b31eab (patch) | |
tree | 8f1cac3f58c6abcf28008a0d482ae193fb90b43d /macosx/tkMacOSXWm.c | |
parent | eb5bb113c80470c68abe015d2b9c755f3127e38b (diff) | |
download | tk-b2961e1a86c13f6505e843476369d46550b31eab.zip tk-b2961e1a86c13f6505e843476369d46550b31eab.tar.gz tk-b2961e1a86c13f6505e843476369d46550b31eab.tar.bz2 |
* macosx/tkMacOSXWindowEvent.c (GenerateUpdateEvent): complete all
pending idle-time redraws before newly posted Expose events are
processed; add bounds of redrawn windows to update region to ensure all
child windows overdrawn by parents are redrawn.
* macosx/tkMacOSXWindowEvent.c: centralize clip and window invalidation
* macosx/tkMacOSXSubwindows.c: after location/size changes in the
* macosx/tkMacOSXWm.c: BoundsChanged carbon event handler;
correct/add window invalidation after window attribute changes.
* macosx/tkMacOSXSubwindows.c (XResizeWindow, XMoveResizeWindow,
XMoveWindow): factor out common code dealing with embedded and
non-toplevel windows; remove unnecessary clip and window invalidation.
* macosx/tkMacOSXButton.c (TkpDisplayButton): move clip setup closer to
native button drawing calls.
* macosx/tkMacOSXWm.c (TkMacOSXIsWindowZoomed, TkMacOSXZoomToplevel):
correct handle gridded windows in max size calculations.
* macosx/tkMacOSXEvent.c (TkMacOSXFlushWindows): use HIWindowFlush API
when available.
* macosx/tkMacOSXColor.c: cleanup whitespace and formatting.
* macosx/tkMacOSXDraw.c:
* macosx/tkMacOSXSubwindows.c:
* macosx/tkMacOSXWm.c:
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 478dc7c..41b79ca 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.7.2.37 2007/05/30 06:39:38 das Exp $ + * RCS: @(#) $Id: tkMacOSXWm.c,v 1.7.2.38 2007/05/31 13:42:13 das Exp $ */ #include "tkMacOSXInt.h" @@ -898,7 +898,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: @@ -4517,6 +4517,7 @@ TkMacOSXGrowToplevel( if (wmPtr->gridWin != NULL) { int base = winPtr->reqWidth - (wmPtr->reqGridWidth * wmPtr->widthInc); + if (base < 0) { base = 0; } @@ -4702,6 +4703,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 { @@ -4749,9 +4763,7 @@ TkMacOSXZoomToplevel( WmInfo *wmPtr; Point idealSize; int maxWidth, maxHeight; - Rect portRect; OSStatus err; - CGrafPtr destPort = GetWindowPort(whichWindow); window = TkMacOSXGetXWindow(whichWindow); dispPtr = TkGetDisplayList(); @@ -4763,6 +4775,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 { @@ -4780,12 +4805,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; @@ -5847,7 +5870,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); @@ -5871,6 +5894,8 @@ ApplyWindowClassAttributeChanges( ChkErr(HIGrowBoxViewSetTransparent, growBoxView, true); } } + TkMacOSXInvalidateWindow((MacDrawable *)(winPtr->window), + TK_PARENT_WINDOW); } /* @@ -6018,8 +6043,6 @@ TkMacOSXMakeFullscreen( ChkErr(SetWindowBounds, window, kWindowContentRgn, &screenBounds); wmPtr->flags &= ~WM_SYNC_PENDING; - TkMacOSXInvalidateWindow((MacDrawable*)winPtr->window, - TK_WINDOW_ONLY); } wmPtr->flags |= WM_FULLSCREEN; } @@ -6039,8 +6062,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; |