summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2012-09-17 13:10:38 (GMT)
committerdgp <dgp@users.sourceforge.net>2012-09-17 13:10:38 (GMT)
commita7ed3710535ad02489545afd8bd9bb587b7cfdd8 (patch)
tree8aaf9e7a4fda4ee1c540fcfbe10e3db2a819a7a9
parentb41e7be57014d7d8f36d1f7acd6ad7a125320463 (diff)
parent0ea7d71c4905741e8b990a41ac36ab8a762d9ac5 (diff)
downloadtk-a7ed3710535ad02489545afd8bd9bb587b7cfdd8.zip
tk-a7ed3710535ad02489545afd8bd9bb587b7cfdd8.tar.gz
tk-a7ed3710535ad02489545afd8bd9bb587b7cfdd8.tar.bz2
3567786 Stop segfault in [wm forget]
-rw-r--r--macosx/tkMacOSXWm.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c
index b651b3c..3a1da10 100644
--- a/macosx/tkMacOSXWm.c
+++ b/macosx/tkMacOSXWm.c
@@ -726,6 +726,9 @@ TkWmDeadWindow(
if (wmPtr == NULL) {
return;
}
+ Tk_ManageGeometry((Tk_Window) winPtr, NULL, NULL);
+ Tk_DeleteEventHandler((Tk_Window) winPtr, StructureNotifyMask,
+ TopLevelEventProc, winPtr);
if (wmPtr->hints.flags & IconPixmapHint) {
Tk_FreeBitmap(winPtr->display, wmPtr->hints.icon_pixmap);
}
@@ -1646,12 +1649,21 @@ WmForgetCmd(
register Tk_Window frameWin = (Tk_Window) winPtr;
if (Tk_IsTopLevel(frameWin)) {
- MacDrawable *macWin = (MacDrawable *) winPtr->parentPtr->window;
+ MacDrawable *macWin;
+
+ Tk_MakeWindowExist(winPtr);
+ Tk_MakeWindowExist(winPtr->parentPtr);
+
+ macWin = (MacDrawable *) winPtr->window;
TkFocusJoin(winPtr);
Tk_UnmapWindow(frameWin);
- TkWmDeadWindow((TkWindow *) macWin);
- RemapWindows(winPtr, macWin);
+
+ macWin->toplevel = winPtr->parentPtr->privatePtr->toplevel;
+ macWin->flags &= ~TK_HOST_EXISTS;
+
+ TkWmDeadWindow(winPtr);
+ RemapWindows(winPtr, (MacDrawable *) winPtr->parentPtr->window);
winPtr->flags &= ~(TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED);