diff options
author | mdejong <mdejong> | 2005-04-07 20:14:19 (GMT) |
---|---|---|
committer | mdejong <mdejong> | 2005-04-07 20:14:19 (GMT) |
commit | 43910e9ccfe1adfe036bdc299b6e6c8a820a03ab (patch) | |
tree | 584a82a346661a20928005a4f4fdc7018af2dd5c /macosx/tkMacOSXWm.c | |
parent | af0c6996b5dd46e602fa5da6542a4ccb4e45656c (diff) | |
download | tk-43910e9ccfe1adfe036bdc299b6e6c8a820a03ab.zip tk-43910e9ccfe1adfe036bdc299b6e6c8a820a03ab.tar.gz tk-43910e9ccfe1adfe036bdc299b6e6c8a820a03ab.tar.bz2 |
* macosx/tkMacOSXWm.c (TkWmStackorderToplevelWrapperMap, TkWmStackorderToplevel):
* unix/tkUnixWm.c (TkWmStackorderToplevelWrapperMap, TkWmStackorderToplevel):
* win/tkWinWm.c (TkWmStackorderToplevelWrapperMap, TkWmStackorderToplevel):
Fix panic in wm stackorder when a toplevel is created on another
diplay. The code now ignores toplevels that have a display
that does not match the display of the parent window.
[Bug 1152809]
Diffstat (limited to 'macosx/tkMacOSXWm.c')
-rw-r--r-- | macosx/tkMacOSXWm.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index ca54f81..fafa6f8 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -12,7 +12,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.16 2005/03/23 22:17:31 wolfsuit Exp $ + * RCS: @(#) $Id: tkMacOSXWm.c,v 1.17 2005/04/07 20:14:24 mdejong Exp $ */ #include <Carbon/Carbon.h> @@ -79,7 +79,9 @@ static int ParseGeometry _ANSI_ARGS_((Tcl_Interp *interp, static void TopLevelEventProc _ANSI_ARGS_((ClientData clientData, XEvent *eventPtr)); static void TkWmStackorderToplevelWrapperMap _ANSI_ARGS_(( - TkWindow *winPtr, Tcl_HashTable *table)); + TkWindow *winPtr, + Display *display, + Tcl_HashTable *table)); static void TopLevelReqProc _ANSI_ARGS_((ClientData dummy, Tk_Window tkwin)); static void UpdateGeometryInfo _ANSI_ARGS_(( @@ -5622,8 +5624,9 @@ TkpChangeFocus(winPtr, force) *---------------------------------------------------------------------- */ static void -TkWmStackorderToplevelWrapperMap(winPtr, table) +TkWmStackorderToplevelWrapperMap(winPtr, display, table) TkWindow *winPtr; /* TkWindow to recurse on */ + Display *display; /* X display of parent window */ Tcl_HashTable *table; /* Maps mac window to TkWindow */ { TkWindow *childPtr; @@ -5631,7 +5634,7 @@ TkWmStackorderToplevelWrapperMap(winPtr, table) WindowRef macWindow; int newEntry; - if (Tk_IsMapped(winPtr) && Tk_IsTopLevel(winPtr)) { + if (Tk_IsMapped(winPtr) && Tk_IsTopLevel(winPtr) && (winPtr->display == display)) { macWindow = GetWindowFromPort(TkMacOSXGetDrawablePort(winPtr->window)); hPtr = Tcl_CreateHashEntry(table, @@ -5641,7 +5644,7 @@ TkWmStackorderToplevelWrapperMap(winPtr, table) for (childPtr = winPtr->childList; childPtr != NULL; childPtr = childPtr->nextPtr) { - TkWmStackorderToplevelWrapperMap(childPtr, table); + TkWmStackorderToplevelWrapperMap(childPtr, display, table); } } @@ -5677,7 +5680,7 @@ TkWmStackorderToplevel(parentPtr) */ Tcl_InitHashTable(&table, TCL_ONE_WORD_KEYS); - TkWmStackorderToplevelWrapperMap(parentPtr, &table); + TkWmStackorderToplevelWrapperMap(parentPtr, parentPtr->display, &table); windows = (TkWindow **) ckalloc((table.numEntries+1) * sizeof(TkWindow *)); |