summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXWm.c
diff options
context:
space:
mode:
authordas <das>2007-10-11 14:13:41 (GMT)
committerdas <das>2007-10-11 14:13:41 (GMT)
commiteb02d6d9d6aefcf7a0e3869fa9667eeea49a6748 (patch)
tree6351ca671fdb17c7153320d023d575d82386e5df /macosx/tkMacOSXWm.c
parent88f37cabad4c7f19e6b6f94fa5dba33e2562f304 (diff)
downloadtk-eb02d6d9d6aefcf7a0e3869fa9667eeea49a6748.zip
tk-eb02d6d9d6aefcf7a0e3869fa9667eeea49a6748.tar.gz
tk-eb02d6d9d6aefcf7a0e3869fa9667eeea49a6748.tar.bz2
* macosx/tkMacOSXWm.c (TkMacOSXGrowToplevel): manually constrain resize
limitBounds to maxBounds, works around SectRect() mis-feature (return zero rect if input rect has zero height/width). [Bug 1810818]
Diffstat (limited to 'macosx/tkMacOSXWm.c')
-rw-r--r--macosx/tkMacOSXWm.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c
index d307bce..de2f46b 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.55 2007/06/29 03:20:02 das Exp $
+ * RCS: @(#) $Id: tkMacOSXWm.c,v 1.56 2007/10/11 14:13:41 das Exp $
*/
#include "tkMacOSXPrivate.h"
@@ -4522,7 +4522,18 @@ TkMacOSXGrowToplevel(
limitBounds.top = limits.top + (strBounds.top + strWidths.top);
limitBounds.bottom = limits.bottom +
(strBounds.top + strWidths.top + strWidths.bottom);
- SectRect(&limitBounds, maxBounds, &limitBounds);
+ if (limitBounds.left < maxBounds->left) {
+ limitBounds.left = maxBounds->left;
+ }
+ if (limitBounds.right > maxBounds->right) {
+ limitBounds.right = maxBounds->right;
+ }
+ if (limitBounds.top < maxBounds->top) {
+ limitBounds.top = maxBounds->top;
+ }
+ if (limitBounds.bottom > maxBounds->bottom) {
+ limitBounds.bottom = maxBounds->bottom;
+ }
limits.left = limitBounds.left - (strBounds.left + strWidths.left);
limits.right = limitBounds.right -
(strBounds.left + strWidths.left + strWidths.right);