diff options
Diffstat (limited to 'macosx/tkMacOSXSubwindows.c')
-rw-r--r-- | macosx/tkMacOSXSubwindows.c | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c index c06dbda..0b46f7c 100644 --- a/macosx/tkMacOSXSubwindows.c +++ b/macosx/tkMacOSXSubwindows.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXSubwindows.c,v 1.2.2.21 2007/11/09 06:26:56 das Exp $ + * RCS: @(#) $Id: tkMacOSXSubwindows.c,v 1.2.2.22 2007/12/18 18:21:31 das Exp $ */ #include "tkMacOSXPrivate.h" @@ -109,7 +109,42 @@ XDestroyWindow( if (winRef) { TkMacOSXWindowList *listPtr, *prevPtr; + WindowGroupRef group; + + if (GetWindowProperty(winRef, 'Tk ', 'TsGp', sizeof(group), + NULL, &group) == noErr) { + TkDisplay *dispPtr = TkGetDisplayList(); + ItemCount i = CountWindowGroupContents(group, + kWindowGroupContentsReturnWindows); + + while (i > 0) { + WindowRef macWin; + + ChkErr(GetIndexedWindow, group, i--, 0, &macWin); + if (macWin) { + WindowGroupRef newGroup = NULL; + Window window = TkMacOSXGetXWindow(macWin); + + if (window != None) { + TkWindow * winPtr = (TkWindow *)Tk_IdToWindow( + dispPtr->display, window); + + if (winPtr && winPtr->wmInfoPtr) { + newGroup = GetWindowGroupOfClass( + winPtr->wmInfoPtr->macClass); + } + } + if (!newGroup) { + newGroup = GetWindowGroupOfClass( + kDocumentWindowClass); + } + ChkErr(SetWindowGroup, macWin, newGroup); + } + } + ChkErr(SetWindowGroupOwner, group, NULL); + ChkErr(ReleaseWindowGroup, group); + } TkMacOSXUnregisterMacWindow(winRef); DisposeWindow(winRef); |