diff options
author | patthoyts <patthoyts@users.sourceforge.net> | 2009-06-02 09:41:42 (GMT) |
---|---|---|
committer | patthoyts <patthoyts@users.sourceforge.net> | 2009-06-02 09:41:42 (GMT) |
commit | caa91573d1ffb67d97604b735dced193464c0bc3 (patch) | |
tree | ffbd02a952c624138f6aed53a94f537573a20140 /tests/winWm.test | |
parent | 473fe655bbd25c1af26b5f1f80c276a1a41e15fb (diff) | |
download | tk-caa91573d1ffb67d97604b735dced193464c0bc3.zip tk-caa91573d1ffb67d97604b735dced193464c0bc3.tar.gz tk-caa91573d1ffb67d97604b735dced193464c0bc3.tar.bz2 |
[Bug 2799589] Backported fix for crash on delayed window activation.
Diffstat (limited to 'tests/winWm.test')
-rw-r--r-- | tests/winWm.test | 51 |
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: |