Tk Source Code

Artifact [b9af91f2]
Login

Artifact b9af91f2e46f613729c36d2b48a975e3aa15d851:

Attachment "tk-wm-transient.patch" to ticket [632816ff] added by jenglish 2003-10-12 01:21:19.
--- unix/tkUnixWm.c.wm-transient.old	2003-03-11 16:25:41.000000000 -0800
+++ unix/tkUnixWm.c	2003-10-11 11:02:04.000000000 -0700
@@ -866,8 +866,8 @@
 	            WmWaitMapProc, (ClientData) wmPtr2->winPtr);
 	    wmPtr2->masterPtr = NULL;
 	    if (!(wmPtr2->flags & WM_NEVER_MAPPED)) {
-		XSetTransientForHint(wmPtr2->winPtr->display,
-		        wmPtr2->wrapperPtr->window, None);
+		XDeleteProperty(winPtr->display, wmPtr2->wrapperPtr->window,
+			Tk_InternAtom((Tk_Window) winPtr, "WM_TRANSIENT_FOR"));
 		/* FIXME: Need a call like Win32's UpdateWrapper() so
 		   we can recreate the wrapper and get rid of the
 		   transient window decorations. */
@@ -3084,10 +3084,13 @@
 		return TCL_ERROR;
 	    }
 	} else {
-	    Window xwin = (wmPtr->masterPtr == NULL) ? None :
-		    wmPtr->masterPtr->wmInfoPtr->wrapperPtr->window;
-	    XSetTransientForHint(winPtr->display, wmPtr->wrapperPtr->window,
-		    xwin);
+	    if (wmPtr->masterPtr != NULL) {
+		XSetTransientForHint(winPtr->display, wmPtr->wrapperPtr->window,
+			wmPtr->masterPtr->wmInfoPtr->wrapperPtr->window);
+	    } else {
+		XDeleteProperty(winPtr->display, wmPtr->wrapperPtr->window,
+			Tk_InternAtom((Tk_Window)winPtr, "WM_TRANSIENT_FOR"));
+	    }
 	}
     }
     return TCL_OK;
--- tests/unixWm.test.wm-transient.old	2003-04-01 13:06:57.000000000 -0800
+++ tests/unixWm.test	2003-10-11 11:13:41.000000000 -0700
@@ -1273,7 +1273,7 @@
 	    [testprop [testwrapper .t2] WM_TRANSIENT_FOR]
     destroy .t2
     set result
-} {{} {} .t 0 {} 0x0}
+} {{} {} .t 0 {} {}}
 test unixWm-37.4 {TkWmDeadWindow, destroy on master should clear transient} {unix testwrapper} {
     catch {destroy .t2}
     toplevel .t2
@@ -1284,7 +1284,7 @@
     destroy .t3
     update
     list [wm transient .t2] [testprop [testwrapper .t2] WM_TRANSIENT_FOR]
-} {{} 0x0}
+} {{} {}}
 test unixWm-37.5 {Tk_WmCmd procedure, "transient" option, create master wrapper} {unix testwrapper} {
     catch {destroy .t2}
     catch {destroy .t3}