summaryrefslogtreecommitdiffstats
path: root/unix/tkUnixWm.c
diff options
context:
space:
mode:
authormdejong <mdejong>2005-04-07 20:14:19 (GMT)
committermdejong <mdejong>2005-04-07 20:14:19 (GMT)
commit43910e9ccfe1adfe036bdc299b6e6c8a820a03ab (patch)
tree584a82a346661a20928005a4f4fdc7018af2dd5c /unix/tkUnixWm.c
parentaf0c6996b5dd46e602fa5da6542a4ccb4e45656c (diff)
downloadtk-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 'unix/tkUnixWm.c')
-rw-r--r--unix/tkUnixWm.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c
index 2094197..d8fe42c 100644
--- a/unix/tkUnixWm.c
+++ b/unix/tkUnixWm.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: tkUnixWm.c,v 1.47 2004/10/06 13:27:45 dgp Exp $
+ * RCS: @(#) $Id: tkUnixWm.c,v 1.48 2005/04/07 20:14:39 mdejong Exp $
*/
#include "tkPort.h"
@@ -326,6 +326,7 @@ static void ReparentEvent _ANSI_ARGS_((WmInfo *wmPtr,
XReparentEvent *eventPtr));
static void TkWmStackorderToplevelWrapperMap _ANSI_ARGS_((
TkWindow *winPtr,
+ Display *display,
Tcl_HashTable *reparentTable));
static void TopLevelReqProc _ANSI_ARGS_((ClientData dummy,
Tk_Window tkwin));
@@ -5618,8 +5619,9 @@ TkWmProtocolEventProc(winPtr, eventPtr)
*/
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 X id to TkWindow */
{
TkWindow *childPtr;
@@ -5628,7 +5630,7 @@ TkWmStackorderToplevelWrapperMap(winPtr, table)
int newEntry;
if (Tk_IsMapped(winPtr) && Tk_IsTopLevel(winPtr) &&
- !Tk_IsEmbedded(winPtr)) {
+ !Tk_IsEmbedded(winPtr) && (winPtr->display == display)) {
wrapper = (winPtr->wmInfoPtr->reparent != None)
? winPtr->wmInfoPtr->reparent
: winPtr->wmInfoPtr->wrapperPtr->window;
@@ -5640,7 +5642,7 @@ TkWmStackorderToplevelWrapperMap(winPtr, table)
for (childPtr = winPtr->childList; childPtr != NULL;
childPtr = childPtr->nextPtr) {
- TkWmStackorderToplevelWrapperMap(childPtr, table);
+ TkWmStackorderToplevelWrapperMap(childPtr, display, table);
}
}
@@ -5678,7 +5680,7 @@ TkWmStackorderToplevel(parentPtr)
*/
Tcl_InitHashTable(&table, TCL_ONE_WORD_KEYS);
- TkWmStackorderToplevelWrapperMap(parentPtr, &table);
+ TkWmStackorderToplevelWrapperMap(parentPtr, parentPtr->display, &table);
window_ptr = windows = (TkWindow **) ckalloc((table.numEntries+1)
* sizeof(TkWindow *));