summaryrefslogtreecommitdiffstats
path: root/unix/tkUnixWm.c
diff options
context:
space:
mode:
authormdejong <mdejong>2002-05-24 09:50:11 (GMT)
committermdejong <mdejong>2002-05-24 09:50:11 (GMT)
commitf9247ee35c133bb545cb53b9cea7f7a9f3a6fd8c (patch)
treebe1f7fe17390fe84a32e09b3bb937e0a17ddadad /unix/tkUnixWm.c
parent7232648b41b68bdd036d35aed2b081ba08809e55 (diff)
downloadtk-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 'unix/tkUnixWm.c')
-rw-r--r--unix/tkUnixWm.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c
index 5fbd83b..e9caba6 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.16 2002/05/23 19:55:18 mdejong Exp $
+ * RCS: @(#) $Id: tkUnixWm.c,v 1.17 2002/05/24 09:50:11 mdejong Exp $
*/
#include "tkPort.h"
@@ -2049,10 +2049,28 @@ Tk_WmCmd(clientData, interp, argc, argv)
master = Tk_Parent(master);
}
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->wrapperPtr == NULL) {
CreateWrapper(wmPtr2);
}
+
+ 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(wmPtr2->wrapperPtr);
if (wmPtr->masterWindowName != NULL) {
ckfree((char *) wmPtr->masterWindowName);