summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordas <das>2006-07-24 04:45:58 (GMT)
committerdas <das>2006-07-24 04:45:58 (GMT)
commit1e8a0d01d5d6750353dc49a1a651a14ac8075070 (patch)
treeb7b0f5b913cd570fba09e71a0820fc310e9740f5
parent8620e6f53c31e7c761d7a745b229de6b94cb3855 (diff)
downloadtk-1e8a0d01d5d6750353dc49a1a651a14ac8075070.zip
tk-1e8a0d01d5d6750353dc49a1a651a14ac8075070.tar.gz
tk-1e8a0d01d5d6750353dc49a1a651a14ac8075070.tar.bz2
* macosx/tkMacOSXWm.c (TkWmMapWindow): fix incorrect values of wmInfo
parentWidth/Height for toplevels by recalculating them once the window is mapped (i.e. once the window&structure sizes are known). [Bug 1358663] (ParseGeometry): sync with ParseGeometry in tkUnixWm.c/tkWinWm.c.
-rw-r--r--ChangeLog7
-rw-r--r--macosx/tkMacOSXWm.c32
2 files changed, 29 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index a007414..5f0d055 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-07-24 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXWm.c (TkWmMapWindow): fix incorrect values of wmInfo
+ parentWidth/Height for toplevels by recalculating them once the window
+ is mapped (i.e. once the window&structure sizes are known). [Bug 1358663]
+ (ParseGeometry): sync with ParseGeometry in tkUnixWm.c/tkWinWm.c.
+
2006-07-21 Daniel Steffen <das@users.sourceforge.net>
* generic/tkBind.c (TkBindInit): for REDO_KEYSYM_LOOKUP, change
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c
index 04d8144..95013c2 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.28 2006/07/20 06:27:34 das Exp $
+ * RCS: @(#) $Id: tkMacOSXWm.c,v 1.7.2.29 2006/07/24 04:45:59 das Exp $
*/
#include "tkMacOSXInt.h"
@@ -321,6 +321,7 @@ TkWmMapWindow(
* be mapped. */
{
WmInfo *wmPtr = winPtr->wmInfoPtr;
+ Rect widths;
if (wmPtr->flags & WM_NEVER_MAPPED) {
wmPtr->flags &= ~WM_NEVER_MAPPED;
@@ -389,12 +390,16 @@ TkWmMapWindow(
XMapWindow(winPtr->display, winPtr->window);
/*
- * Now that the window is visable we can determine the offset
+ * Now that the window is visible we can determine the offset
* from the window's content orgin to the window's decorative
* orgin (structure orgin).
*/
- TkMacOSXWindowOffset( GetWindowFromPort(TkMacOSXGetDrawablePort(Tk_WindowId(winPtr))),
- &wmPtr->xInParent, &wmPtr->yInParent);
+ GetWindowStructureWidths(GetWindowFromPort(TkMacOSXGetDrawablePort(
+ Tk_WindowId(winPtr))), &widths);
+ wmPtr->xInParent = widths.left;
+ wmPtr->yInParent = widths.top;
+ wmPtr->parentWidth = winPtr->changes.width + widths.left + widths.right;
+ wmPtr->parentHeight = winPtr->changes.height + widths.top + widths.bottom;
}
/*
@@ -3508,14 +3513,22 @@ ParseGeometry(
} else if (*p != '+') {
goto error;
}
- x = strtol(p+1, &end, 10);
+ p++;
+ if (!isdigit(UCHAR(*p)) && (*p != '-')) {
+ goto error;
+ }
+ x = strtol(p, &end, 10);
p = end;
if (*p == '-') {
flags |= WM_NEGATIVE_Y;
} else if (*p != '+') {
goto error;
}
- y = strtol(p+1, &end, 10);
+ p++;
+ if (!isdigit(UCHAR(*p)) && (*p != '-')) {
+ goto error;
+ }
+ y = strtol(p, &end, 10);
if (*end != '\0') {
goto error;
}
@@ -3556,9 +3569,8 @@ ParseGeometry(
}
return TCL_OK;
- error:
- Tcl_AppendResult(interp, "bad geometry specifier \"",
- string, "\"", (char *) NULL);
+ error:
+ Tcl_AppendResult(interp, "bad geometry specifier \"", string, "\"", NULL);
return TCL_ERROR;
}
@@ -4134,7 +4146,7 @@ TkWmRestackToplevel(
*/
} else if (otherMacWindow == frontWindow || otherMacWindow == NULL) {
/*
- * Raise the window to the top. If the window is visable then
+ * Raise the window to the top. If the window is visible then
* we also make it the active window.
*/