diff options
author | mdejong <mdejong> | 2002-05-24 09:50:11 (GMT) |
---|---|---|
committer | mdejong <mdejong> | 2002-05-24 09:50:11 (GMT) |
commit | f9247ee35c133bb545cb53b9cea7f7a9f3a6fd8c (patch) | |
tree | be1f7fe17390fe84a32e09b3bb937e0a17ddadad /win/tkWinWm.c | |
parent | 7232648b41b68bdd036d35aed2b081ba08809e55 (diff) | |
download | tk-f9247ee35c133bb545cb53b9cea7f7a9f3a6fd8c.zip tk-f9247ee35c133bb545cb53b9cea7f7a9f3a6fd8c.tar.gz tk-f9247ee35c133bb545cb53b9cea7f7a9f3a6fd8c.tar.bz2 |
* mac/tkMacWm.c (Tk_WmCmd):
* tests/unixWm.test: Move wm transient checks over
to wm.test so they will be run on all systems.
* tests/wm.test: Add tests to check for error when
an iconwindow is passed to the wm transient command.
* unix/tkUnixWm.c (Tk_WmCmd):
* win/tkWinWm.c (Tk_WmCmd): Raise an error if one
of the windows passed to the wm transient command
is an iconwindow for another toplevel.
Diffstat (limited to 'win/tkWinWm.c')
-rw-r--r-- | win/tkWinWm.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/win/tkWinWm.c b/win/tkWinWm.c index 588ac71..046a931 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.36 2002/05/23 19:55:19 mdejong Exp $ + * RCS: @(#) $Id: tkWinWm.c,v 1.37 2002/05/24 09:50:11 mdejong Exp $ */ #include "tkWinInt.h" @@ -3261,6 +3261,7 @@ Tk_WmCmd(clientData, interp, argc, argv) } else if ((c == 't') && (strncmp(argv[1], "transient", length) == 0) && (length >= 3)) { TkWindow *masterPtr = wmPtr->masterPtr; + WmInfo *wmPtr2; if ((argc != 3) && (argc != 4)) { Tcl_AppendResult(interp, "wrong # arguments: must be \"", @@ -3302,6 +3303,25 @@ Tk_WmCmd(clientData, interp, argc, argv) while (!(masterPtr->flags & TK_TOP_LEVEL)) { masterPtr = masterPtr->parentPtr; } + + if (wmPtr->iconFor != NULL) { + Tcl_AppendResult(interp, "can't make \"", argv[2], + "\" a transient: it is an icon for ", + Tk_PathName(wmPtr->iconFor), + (char *) NULL); + return TCL_ERROR; + } + + wmPtr2 = masterPtr->wmInfoPtr; + + if (wmPtr2->iconFor != NULL) { + Tcl_AppendResult(interp, "can't make \"", argv[3], + "\" a master: it is an icon for ", + Tk_PathName(wmPtr2->iconFor), + (char *) NULL); + return TCL_ERROR; + } + wmPtr->masterPtr = masterPtr; masterPtr->wmInfoPtr->numTransients++; |