summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <dkf@noemail.net>2010-01-06 09:25:13 (GMT)
committerdkf <dkf@noemail.net>2010-01-06 09:25:13 (GMT)
commitc86045ad79eec91f9de8e2f529263a2f2a3cc2f8 (patch)
treeed4485d70c366f86cb8eeb1c8400c6a4ce5e7998
parent14d52450128a515ff22be6f1845cea9ceb3336c3 (diff)
downloadtk-c86045ad79eec91f9de8e2f529263a2f2a3cc2f8.zip
tk-c86045ad79eec91f9de8e2f529263a2f2a3cc2f8.tar.gz
tk-c86045ad79eec91f9de8e2f529263a2f2a3cc2f8.tar.bz2
[Bug 1163496]: Allow windows to be set to be transients for withdrawn masters
correctly. FossilOrigin-Name: 051f375e6a0dedd49fd619a793eb6a3a3fb33d50
-rw-r--r--ChangeLog10
-rw-r--r--tests/wm.test19
-rw-r--r--unix/tkUnixWm.c14
3 files changed, 35 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 89590e1..a7824f1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,13 @@
+2010-01-06 Donal K. Fellows <dkf@users.sf.net>
+
+ * unix/tkUnixWm.c (TkWmMapWindow): [Bug 1163496]: Allow windows to be
+ * tests/wm.test (wm-transient-8.1): set to be transients for withdrawn
+ masters correctly.
+
2010-01-05 Pat Thoyts <patthoyts@users.sourceforge.net>
- * win/tkWinDialog.c: [Patch 2898255] Enable unlimited multiple
- file selection from the open files dialog (pawlak,fellows,thoyts)
+ * win/tkWinDialog.c: [Patch 2898255]: Enable unlimited multiple file
+ selection from the open files dialog. (pawlak,fellows,thoyts)
2010-01-05 Donal K. Fellows <dkf@users.sf.net>
diff --git a/tests/wm.test b/tests/wm.test
index f28eeab..1fd024f 100644
--- a/tests/wm.test
+++ b/tests/wm.test
@@ -7,7 +7,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: wm.test,v 1.46 2008/11/15 00:00:27 patthoyts Exp $
+# RCS: @(#) $Id: wm.test,v 1.47 2010/01/06 09:25:15 dkf Exp $
# This file tests window manager interactions that work across platforms.
# Window manager tests that only work on a specific platform should be placed
@@ -1893,6 +1893,23 @@ test wm-transient-7.5 {Reassign transient, destroy transient} -body {
deleteWindows
}
+test wm-transient-8.1 {transient to withdrawn window, Bug 1163496} -setup {
+ deleteWindows
+ set result {}
+} -body {
+ # Verifies that transients stay on top of their masters, even if they were
+ # made transients when those masters were withdrawn.
+ toplevel .t1; wm withdraw .t1; update
+ toplevel .t2; wm transient .t2 .t1; update
+ lappend result [winfo ismapped .t1] [winfo ismapped .t2]
+ wm deiconify .t1; update
+ lappend result [winfo ismapped .t1] [winfo ismapped .t2]
+ raise .t1; update
+ lappend result [lsearch -all -inline -glob [wm stackorder .] ".t?"]
+} -cleanup {
+ deleteWindows
+} -result {0 0 1 1 {.t1 .t2}}
+
### wm state ###
test wm-state-1.1 {usage} -returnCodes error -body {
diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c
index 3b0d3cb..adfb31d 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.77 2009/12/09 13:55:14 dkf Exp $
+ * RCS: @(#) $Id: tkUnixWm.c,v 1.78 2010/01/06 09:25:15 dkf Exp $
*/
#include "tkUnixInt.h"
@@ -676,11 +676,15 @@ TkWmMapWindow(
if (!Tk_IsMapped(wmPtr->masterPtr)) {
wmPtr->withdrawn = 1;
wmPtr->hints.initial_state = WithdrawnState;
- } else {
- XSetTransientForHint(winPtr->display,
- wmPtr->wrapperPtr->window,
- wmPtr->masterPtr->wmInfoPtr->wrapperPtr->window);
}
+
+ /*
+ * Make sure that we actually set the transient-for property, even
+ * if we are withdrawn. [Bug 1163496]
+ */
+
+ XSetTransientForHint(winPtr->display, wmPtr->wrapperPtr->window,
+ wmPtr->masterPtr->wmInfoPtr->wrapperPtr->window);
}
wmPtr->flags |= WM_UPDATE_SIZE_HINTS;