summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog10
-rw-r--r--macosx/tkMacOSXWm.c15
-rw-r--r--unix/tkUnixWm.c12
-rw-r--r--win/tkWinWm.c12
4 files changed, 33 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index ba2e4ba..b84d728 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2005-04-07 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * 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]
+
2005-04-06 Donal K. Fellows <dkf@users.sf.net>
* doc/wm.n, doc/winfo.n, doc/tk.n, doc/send.n, doc/selection.n:
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 *));
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 *));
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index bac067e..941d726 100644
--- a/win/tkWinWm.c
+++ b/win/tkWinWm.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: tkWinWm.c,v 1.98 2005/03/08 21:54:33 hobbs Exp $
+ * RCS: @(#) $Id: tkWinWm.c,v 1.99 2005/04/07 20:14:42 mdejong Exp $
*/
#include "tkWinInt.h"
@@ -433,6 +433,7 @@ static void RefreshColormap _ANSI_ARGS_((Colormap colormap,
static void SetLimits _ANSI_ARGS_((HWND hwnd, MINMAXINFO *info));
static void TkWmStackorderToplevelWrapperMap _ANSI_ARGS_((
TkWindow *winPtr,
+ Display *display,
Tcl_HashTable *table));
static LRESULT CALLBACK TopLevelProc _ANSI_ARGS_((HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam));
@@ -6342,8 +6343,9 @@ BOOL CALLBACK TkWmStackorderToplevelEnumProc(hwnd, lParam)
*/
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; /* Table to maps HWND to TkWindow */
{
TkWindow *childPtr;
@@ -6352,7 +6354,7 @@ TkWmStackorderToplevelWrapperMap(winPtr, table)
int newEntry;
if (Tk_IsMapped(winPtr) && Tk_IsTopLevel(winPtr) &&
- !Tk_IsEmbedded(winPtr)) {
+ !Tk_IsEmbedded(winPtr) && (winPtr->display == display)) {
wrapper = TkWinGetWrapperWindow((Tk_Window) winPtr);
/*fprintf(stderr, "Mapped HWND %d to %x (%s)\n", wrapper,
@@ -6365,7 +6367,7 @@ TkWmStackorderToplevelWrapperMap(winPtr, table)
for (childPtr = winPtr->childList; childPtr != NULL;
childPtr = childPtr->nextPtr) {
- TkWmStackorderToplevelWrapperMap(childPtr, table);
+ TkWmStackorderToplevelWrapperMap(childPtr, display, table);
}
}
/*
@@ -6400,7 +6402,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 *));