summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXWm.c
diff options
context:
space:
mode:
authormdejong <mdejong>2005-06-01 00:07:27 (GMT)
committermdejong <mdejong>2005-06-01 00:07:27 (GMT)
commit40a9e744774cb13cb682cab51a2880c6f6d76737 (patch)
tree9582bbb522da0475e95814fc5ef15359abd54da7 /macosx/tkMacOSXWm.c
parentfc78e34773eccf9b18da80e95c97c21a9f95bdb7 (diff)
downloadtk-40a9e744774cb13cb682cab51a2880c6f6d76737.zip
tk-40a9e744774cb13cb682cab51a2880c6f6d76737.tar.gz
tk-40a9e744774cb13cb682cab51a2880c6f6d76737.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.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c
index 81667e3..ca385df 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.7.2.8 2005/05/14 20:53:31 das Exp $
+ * RCS: @(#) $Id: tkMacOSXWm.c,v 1.7.2.9 2005/06/01 00:07:28 mdejong Exp $
*/
#include <Carbon/Carbon.h>
@@ -73,7 +73,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_((
@@ -5626,8 +5628,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;
@@ -5635,7 +5638,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,
@@ -5645,7 +5648,7 @@ TkWmStackorderToplevelWrapperMap(winPtr, table)
for (childPtr = winPtr->childList; childPtr != NULL;
childPtr = childPtr->nextPtr) {
- TkWmStackorderToplevelWrapperMap(childPtr, table);
+ TkWmStackorderToplevelWrapperMap(childPtr, display, table);
}
}
@@ -5681,7 +5684,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 *));