summaryrefslogtreecommitdiffstats
path: root/win/tkWinWm.c
diff options
context:
space:
mode:
Diffstat (limited to 'win/tkWinWm.c')
-rw-r--r--win/tkWinWm.c56
1 files changed, 29 insertions, 27 deletions
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index 046a931..207dc4f 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.37 2002/05/24 09:50:11 mdejong Exp $
+ * RCS: @(#) $Id: tkWinWm.c,v 1.38 2002/05/27 22:54:42 mdejong Exp $
*/
#include "tkWinInt.h"
@@ -3291,37 +3291,39 @@ Tk_WmCmd(clientData, interp, argc, argv)
if (masterPtr == NULL) {
return TCL_ERROR;
}
- if (masterPtr == winPtr) {
- wmPtr->masterPtr = NULL;
- } else if (masterPtr != wmPtr->masterPtr) {
- Tk_MakeWindowExist((Tk_Window)masterPtr);
-
- /*
- * Ensure that the master window is actually a Tk toplevel.
- */
+ while (!(masterPtr->flags & TK_TOP_LEVEL)) {
+ /*
+ * Ensure that the master window is actually a Tk toplevel.
+ */
- while (!(masterPtr->flags & TK_TOP_LEVEL)) {
- masterPtr = masterPtr->parentPtr;
- }
+ masterPtr = masterPtr->parentPtr;
+ }
+ Tk_MakeWindowExist((Tk_Window)masterPtr);
- 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;
- }
+ 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;
+ 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;
- }
+ 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;
+ }
+ 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;
masterPtr->wmInfoPtr->numTransients++;