Tk Source Code

Artifact [500a7b00]
Login

Artifact 500a7b00a4e28f7119e5925656ad070fc3fb2770:

Attachment "stay-withdrawn.patch" to ticket [644356ff] added by jenglish 2002-11-27 05:15:42.
Index: ChangeLog
===================================================================
RCS file: /cvsroot/tktoolkit/tk/ChangeLog,v
retrieving revision 1.688
diff -u -r1.688 ChangeLog
--- ChangeLog	22 Nov 2002 23:25:19 -0000	1.688
+++ ChangeLog	26 Nov 2002 22:12:32 -0000
@@ -1,3 +1,8 @@
+2002-11-26  Joe English  <[email protected]>
+
+	* unix/tkUnixWm.c: Keep track of [wm withdraw]n state 
+	for all windows, not just ones that are (currently) transient.
+
 2002-11-22  Jeff Hobbs  <[email protected]>
 
 	* tests/textDisp.test:
Index: unix/tkUnixWm.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/unix/tkUnixWm.c,v
retrieving revision 1.34
diff -u -r1.34 tkUnixWm.c
--- unix/tkUnixWm.c	2 Sep 2002 21:21:14 -0000	1.34
+++ unix/tkUnixWm.c	26 Nov 2002 22:12:33 -0000
@@ -244,8 +244,8 @@
  *				allow the user to change the height of the
  *				window (controlled by "wm resizable"
  *				command).
- * WM_TRANSIENT_WITHDRAWN -	non-zero means that this is a transient window
- *				that has explicitly been withdrawn. It should
+ * WM_WITHDRAWN -		non-zero means that this window has explicitly
+ *				been withdrawn.  If it's a transient, it should
  *				not mirror state changes in the master.
  */
 
@@ -262,7 +262,7 @@
 #define WM_ADDED_TOPLEVEL_COLORMAP	0x800
 #define WM_WIDTH_NOT_RESIZABLE		0x1000
 #define WM_HEIGHT_NOT_RESIZABLE		0x2000
-#define WM_TRANSIENT_WITHDRAWN		0x4000
+#define WM_WITHDRAWN			0x4000
 
 /*
  * This module keeps a list of all top-level windows, primarily to
@@ -1488,9 +1488,7 @@
 		": it is an embedded window", (char *) NULL);
 	return TCL_ERROR;
     }
-    if (wmPtr->flags & WM_TRANSIENT_WITHDRAWN) {
-	wmPtr->flags &= ~WM_TRANSIENT_WITHDRAWN;
-    }
+    wmPtr->flags &= ~WM_WITHDRAWN;
     TkpWmSetState(winPtr, NormalState);
     return TCL_OK;
 }
@@ -2843,9 +2841,7 @@
 	}
 
 	if (index == OPT_NORMAL) {
-	    if (wmPtr->flags & WM_TRANSIENT_WITHDRAWN) {
-		wmPtr->flags &= ~WM_TRANSIENT_WITHDRAWN;
-	    }
+	    wmPtr->flags &= ~WM_WITHDRAWN;
 	    (void) TkpWmSetState(winPtr, NormalState);
 	} else if (index == OPT_ICONIC) {
 	    if (Tk_Attributes((Tk_Window) winPtr)->override_redirect) {
@@ -2868,9 +2864,7 @@
 		return TCL_ERROR;
 	    }
 	} else { /* OPT_WITHDRAWN */
-	    if (wmPtr->masterPtr != NULL) {
-		wmPtr->flags |= WM_TRANSIENT_WITHDRAWN;
-	    }
+	    wmPtr->flags |= WM_WITHDRAWN;
 	    if (TkpWmSetState(winPtr, WithdrawnState) == 0) {
 		Tcl_SetResult(interp,
 			"couldn't send withdraw message to window manager",
@@ -3133,9 +3127,7 @@
 		(char *) NULL);
 	return TCL_ERROR;
     }
-    if (wmPtr->masterPtr != NULL) {
-	wmPtr->flags |= WM_TRANSIENT_WITHDRAWN;
-    }
+    wmPtr->flags |= WM_WITHDRAWN;
     if (TkpWmSetState(winPtr, WithdrawnState) == 0) {
 	Tcl_SetResult(interp,
 		"couldn't send withdraw message to window manager",
@@ -3176,7 +3168,7 @@
         return;
 
     if (eventPtr->type == MapNotify) {
-        if (!(winPtr->wmInfoPtr->flags & WM_TRANSIENT_WITHDRAWN))
+        if (!(winPtr->wmInfoPtr->flags & WM_WITHDRAWN))
             (void) TkpWmSetState(winPtr, NormalState);
     } else if (eventPtr->type == UnmapNotify) {
         (void) TkpWmSetState(winPtr, WithdrawnState);