diff options
author | mdejong <mdejong> | 2002-05-27 22:54:42 (GMT) |
---|---|---|
committer | mdejong <mdejong> | 2002-05-27 22:54:42 (GMT) |
commit | 58d92604a30257de040aa13dceed23dae1a13b03 (patch) | |
tree | 4df8b5fe8d050ea301707b1a94f1f4fd55265556 /unix/tkUnixWm.c | |
parent | f7ac01cec1586ca9a6cfafaf1a404e5a44ffff4f (diff) | |
download | tk-58d92604a30257de040aa13dceed23dae1a13b03.zip tk-58d92604a30257de040aa13dceed23dae1a13b03.tar.gz tk-58d92604a30257de040aa13dceed23dae1a13b03.tar.bz2 |
* changes: Document [wm transient .t .t] error.
* tests/wm.test: Check that setting a window
as a transient of itself raises an error. Check
that passing a non-toplevel window to the wm
transient command uses the enclosing toplevel.
* unix/tkUnixWm.c (Tk_WmCmd): Raise an error
if the user tries to make a toplevel a
transient of itself.
* win/tkWinWm.c (Tk_WmCmd): Raise an error
if the user tries to make a toplevel a
transient of itself. Test for other error
before checking for the transient self error.
Diffstat (limited to 'unix/tkUnixWm.c')
-rw-r--r-- | unix/tkUnixWm.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c index 458c80f..50bd41a 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.19 2002/05/27 20:34:32 mdejong Exp $ + * RCS: @(#) $Id: tkUnixWm.c,v 1.20 2002/05/27 22:54:42 mdejong Exp $ */ #include "tkPort.h" @@ -2014,7 +2014,14 @@ Tk_WmCmd(clientData, interp, argc, argv) return TCL_ERROR; } - wmPtr->masterPtr = masterPtr; + if (masterPtr == winPtr) { + Tcl_AppendResult(interp, "can't make \"", Tk_PathName(winPtr), + "\" its own master", + (char *) NULL); + return TCL_ERROR; + } else if (masterPtr != wmPtr->masterPtr) { + wmPtr->masterPtr = masterPtr; + } } if (!(wmPtr->flags & WM_NEVER_MAPPED)) { Window xwin = (wmPtr->masterPtr == NULL) ? None : |