summaryrefslogtreecommitdiffstats
path: root/mac
diff options
context:
space:
mode:
authormdejong <mdejong@noemail.net>2002-05-24 09:50:11 (GMT)
committermdejong <mdejong@noemail.net>2002-05-24 09:50:11 (GMT)
commit988f2391a48376e23d4f50e455a119682ecefe9c (patch)
treebe1f7fe17390fe84a32e09b3bb937e0a17ddadad /mac
parent18b778a375c1c4f737dd0422453ff334ff1a9922 (diff)
downloadtk-988f2391a48376e23d4f50e455a119682ecefe9c.zip
tk-988f2391a48376e23d4f50e455a119682ecefe9c.tar.gz
tk-988f2391a48376e23d4f50e455a119682ecefe9c.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. FossilOrigin-Name: 7e89e7df59b461e3f3179063e3ef13a04505a48c
Diffstat (limited to 'mac')
-rw-r--r--mac/tkMacWm.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/mac/tkMacWm.c b/mac/tkMacWm.c
index 1d2a8c5..ae2cfc5 100644
--- a/mac/tkMacWm.c
+++ b/mac/tkMacWm.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacWm.c,v 1.16 2002/05/23 19:55:18 mdejong Exp $
+ * RCS: @(#) $Id: tkMacWm.c,v 1.17 2002/05/24 09:50:11 mdejong Exp $
*/
#include <Gestalt.h>
@@ -1744,6 +1744,7 @@ Tk_WmCmd(
} else if ((c == 't') && (strncmp(argv[1], "transient", length) == 0)
&& (length >= 3)) {
Tk_Window master;
+ WmInfo *wmPtr2;
if ((argc != 3) && (argc != 4)) {
Tcl_AppendResult(interp, "wrong # arguments: must be \"",
@@ -1769,6 +1770,25 @@ Tk_WmCmd(
return TCL_ERROR;
}
Tk_MakeWindowExist(master);
+
+ 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 = ((TkWindow *) master)->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->master = Tk_WindowId(master);
wmPtr->masterWindowName = ckalloc((unsigned) (strlen(argv[3])+1));
strcpy(wmPtr->masterWindowName, argv[3]);