summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpatthoyts <patthoyts@users.sourceforge.net>2009-09-30 22:52:32 (GMT)
committerpatthoyts <patthoyts@users.sourceforge.net>2009-09-30 22:52:32 (GMT)
commit22d313609c13a93c26cb1347aa931d255b07d868 (patch)
tree0bccc2d0c2f43b7da6aec0b2d8de3986701e4b27
parent15cfea56bc85d5b5b7a44fbc46f54e8c9d32b959 (diff)
downloadtk-22d313609c13a93c26cb1347aa931d255b07d868.zip
tk-22d313609c13a93c26cb1347aa931d255b07d868.tar.gz
tk-22d313609c13a93c26cb1347aa931d255b07d868.tar.bz2
[Bug 2799589] added a test for grab on deleted window which
causes crashes on windows (fixed already).
-rw-r--r--ChangeLog4
-rw-r--r--tests/winWm.test46
2 files changed, 49 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index cf7eee9..fbf8872 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-09-30 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * tests/winWm.test: [Bug 2799589] grab on deleted window.
+
2009-09-25 Donal K. Fellows <dkf@users.sf.net>
* generic/tkImgPhoto.c (ImgGetPhoto): Correct generation of grayscale
diff --git a/tests/winWm.test b/tests/winWm.test
index 38e8f64..7260a06 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.23 2009/06/13 12:02:14 dgp Exp $
+# RCS: @(#) $Id: winWm.test,v 1.24 2009/09/30 22:52:32 patthoyts Exp $
package require tcltest 2.2
namespace import ::tcltest::*
@@ -489,6 +489,50 @@ test winWm-9.0 "Bug #2799589 - delayed activation of destroyed window" -constrai
destroy .tx .t .sd
} -result {ok}
+test winWm-9.1 "delayed activation of grabbed destroyed window" -constraints win -setup {
+ proc winwm91click {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 winwm91proc3 {} {
+ global winwm91done winwm91check
+ set w .sd
+ toplevel $w
+ pack [button $w.b -text "OK" -command {set winwm91check 1}]
+ bind $w.b <Map> {after idle {winwm91click %W}}
+ update idletasks
+ tkwait visibility $w
+ grab $w
+ tkwait variable winwm91check
+ #skip the release: #grab release $w
+ destroy $w
+ after idle {set winwm91done ok}
+ }
+ proc winwm91proc2 {w} { winwm91proc3; destroy $w }
+ proc winwm91proc1 {w} {
+ toplevel $w
+ pack [button $w.b -text "Do dialog" -command [list winwm91proc2 $w]]
+ bind $w.b <Map> {bind %W <Map> {}; after idle {winwm91click %W}}
+ }
+ destroy .t
+ global winwm91done
+ set winwm91done wait
+ toplevel .t
+} -body {
+ pack [button .t.b -text "Show" -command {winwm91proc1 .tx}]
+ bind .t.b <Map> {bind %W <Map> {}; after idle {winwm91click %W}}
+ after 5000 {set winwm91done timeout}
+ vwait winwm91done
+ set winwm91done
+} -cleanup {
+ foreach cmd {proc1 proc2 proc3 click} {
+ rename winwm91$cmd {}
+ }
+ destroy .tx .t .sd
+} -result {ok}
destroy .t
# cleanup