summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjenglish <jenglish@flightlab.com>2003-10-15 20:04:02 (GMT)
committerjenglish <jenglish@flightlab.com>2003-10-15 20:04:02 (GMT)
commit4c4b8b6c503a4f946ae7b5c6f027f26f61c3c923 (patch)
tree1ca5c0c724c3e757b0136a7cd9d8db3ac431373c
parent354cb2f6a16e65c941bfd27988f05cf585b354c9 (diff)
downloadtk-4c4b8b6c503a4f946ae7b5c6f027f26f61c3c923.zip
tk-4c4b8b6c503a4f946ae7b5c6f027f26f61c3c923.tar.gz
tk-4c4b8b6c503a4f946ae7b5c6f027f26f61c3c923.tar.bz2
Delete WM_TRANSIENT_FOR property instead of setting it to None
when making a window nontransient [Bug #632816 "cannot remove transient"]
-rw-r--r--ChangeLog5
-rw-r--r--tests/unixWm.test6
-rw-r--r--unix/tkUnixWm.c17
3 files changed, 18 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 308b273..91b547d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2003-10-15 Joe English <jenglish@users.sourceforge.net>
+ * unix/tkUnixWm.c, tests/unixWm.test: Delete WM_TRANSIENT_FOR
+ property instead of setting it to None when making a window
+ nontransient [Bug #632816 "cannot remove transient"]
+
2003-10-14 Joe English <jenglish@users.sourceforge.net>
* unix/tkUnixPort.h(TkPutImage): changed macro argument names
to match function argument names ('dest' and 'src' were
diff --git a/tests/unixWm.test b/tests/unixWm.test
index 58035bb..a361b3e 100644
--- a/tests/unixWm.test
+++ b/tests/unixWm.test
@@ -7,7 +7,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: unixWm.test,v 1.34 2003/04/01 21:06:57 dgp Exp $
+# RCS: @(#) $Id: unixWm.test,v 1.35 2003/10/15 20:04:03 jenglish Exp $
package require tcltest 2.2
eval tcltest::configure $argv
@@ -1273,7 +1273,7 @@ test unixWm-37.3 {Tk_WmCmd procedure, "transient" option} {unix testwrapper} {
[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 @@ test unixWm-37.4 {TkWmDeadWindow, destroy on master should clear transient} {uni
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}
diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c
index 5721b02..0d535ea 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.37 2003/03/12 00:25:41 mdejong Exp $
+ * RCS: @(#) $Id: tkUnixWm.c,v 1.38 2003/10/15 20:04:03 jenglish Exp $
*/
#include "tkPort.h"
@@ -866,8 +866,8 @@ TkWmDeadWindow(winPtr)
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 @@ WmTransientCmd(tkwin, winPtr, interp, objc, objv)
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;