summaryrefslogtreecommitdiffstats
path: root/tests/winWm.test
diff options
context:
space:
mode:
authorpatthoyts@users.sourceforge.net <patthoyts>2009-06-02 09:41:42 (GMT)
committerpatthoyts@users.sourceforge.net <patthoyts>2009-06-02 09:41:42 (GMT)
commitc41393189666ed1deab604be5284005fbc8d10a5 (patch)
treeffbd02a952c624138f6aed53a94f537573a20140 /tests/winWm.test
parent1b594c103b4fe4f5a908a454d372e2683d0672d4 (diff)
downloadtk-c41393189666ed1deab604be5284005fbc8d10a5.zip
tk-c41393189666ed1deab604be5284005fbc8d10a5.tar.gz
tk-c41393189666ed1deab604be5284005fbc8d10a5.tar.bz2
[Bug 2799589] Backported fix for crash on delayed window activation.
Diffstat (limited to 'tests/winWm.test')
-rw-r--r--tests/winWm.test51
1 files changed, 50 insertions, 1 deletions
diff --git a/tests/winWm.test b/tests/winWm.test
index 0b5592a..c69226b 100644
--- a/tests/winWm.test
+++ b/tests/winWm.test
@@ -9,7 +9,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: winWm.test,v 1.18 2006/12/01 19:48:00 hobbs Exp $
+# RCS: @(#) $Id: winWm.test,v 1.18.4.1 2009/06/02 09:41:42 patthoyts Exp $
package require tcltest 2.1
eval tcltest::configure $argv
@@ -370,8 +370,57 @@ test winWm-8.2 {Tk_WmCmd procedure, "iconphoto" option} win {
image delete blank16 blank32
} {}
+test winWm-9.0 "Bug #2799589 - delayed activation of destroyed window" -setup {
+ proc winwm90click {w} {
+ if {![winfo ismapped $w]} { update }
+ event generate $w <Enter>
+ focus -force $w
+ event generate $w <ButtonPress-1> -x 5 -y 5
+ event generate $w <ButtonRelease-1> -x 5 -y 5
+ }
+ proc winwm90proc3 {} {
+ global winwm90done winwm90check
+ set w .sd
+ toplevel $w
+ pack [button $w.b -text "OK" -command {set winwm90check 1}]
+ bind $w.b <Map> {after idle {winwm90click %W}}
+ update idletasks
+ tkwait visibility $w
+ grab $w
+ tkwait variable winwm90check
+ grab release $w
+ destroy $w
+ after idle {set winwm90done ok}
+ }
+ proc winwm90proc2 {w} { winwm90proc3; destroy $w }
+ proc winwm90proc1 {w} {
+ toplevel $w
+ pack [button $w.b -text "Do dialog" -command [list winwm90proc2 $w]]
+ bind $w.b <Map> {bind %W <Map> {}; after idle {winwm90click %W}}
+ }
+ destroy .t
+ global winwm90done
+ set winwm90done wait
+ toplevel .t
+} -body {
+ pack [button .t.b -text "Show" -command {winwm90proc1 .tx}]
+ bind .t.b <Map> {bind %W <Map> {}; after idle {winwm90click %W}}
+ after 5000 {set winwm90done timeout}
+ vwait winwm90done
+ set winwm90done
+} -cleanup {
+ foreach cmd {proc1 proc2 proc3 click} {
+ rename winwm90$cmd {}
+ }
+ destroy .tx .t .sd
+} -result {ok}
+
destroy .t
# cleanup
cleanupTests
return
+
+# Local variables:
+# mode: tcl
+# End: