summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXWm.c
diff options
context:
space:
mode:
authordas <das>2007-05-31 13:38:13 (GMT)
committerdas <das>2007-05-31 13:38:13 (GMT)
commit374e000a01924c7de4eb44cdec25581214de0630 (patch)
treee2d1166c8c3d68d89d570e6d4a60e2fa5bd33f82 /macosx/tkMacOSXWm.c
parente9883bba4b0507959e2d037aca5db25e08a298cc (diff)
downloadtk-374e000a01924c7de4eb44cdec25581214de0630.zip
tk-374e000a01924c7de4eb44cdec25581214de0630.tar.gz
tk-374e000a01924c7de4eb44cdec25581214de0630.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.c43
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;