summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2020-02-17 22:06:26 (GMT)
committerfvogel <fvogelnew1@free.fr>2020-02-17 22:06:26 (GMT)
commit2eba29238e00ddad8847d54417625dd5dcf4e781 (patch)
tree04bf61e1bc1b2565deeb6e899c4f873fccb58bc8 /tests
parent08f5935d05a1685e01aee43a12413aff89a70e6a (diff)
downloadtk-2eba29238e00ddad8847d54417625dd5dcf4e781.zip
tk-2eba29238e00ddad8847d54417625dd5dcf4e781.tar.gz
tk-2eba29238e00ddad8847d54417625dd5dcf4e781.tar.bz2
Refine test bind-35.1 once more since [grab current] returns the eventualGrabWin while we're interested in the grabWin instead.
Diffstat (limited to 'tests')
-rw-r--r--tests/bind.test18
-rw-r--r--tests/constraints.tcl1
2 files changed, 12 insertions, 7 deletions
diff --git a/tests/bind.test b/tests/bind.test
index dfb046c..a001580 100644
--- a/tests/bind.test
+++ b/tests/bind.test
@@ -6707,12 +6707,15 @@ test bind-34.3 {-warp works with null or negative coordinates} -setup {
} -cleanup {
} -result {ok ok ok ok}
-test bind-35.1 {pointer warp with grab on master, bug [e3888d5820]} -setup {
- proc waitForGrab {grabWin in_ni} {
- # process events while $grabWin is not in (ni) the current grab window list,
- # or while it is (in), but don't spend more than 5 seconds doing this
+test bind-35.1 {pointer warp with grab on master, bug [e3888d5820]} -constraints {
+ testgrab
+} -setup {
+ proc waitForGrab {type grabWin} {
+ # process events while $grabWin is not grabbed ($type == "grabbed"),
+ # or while $grabWin is not released ($type == "released"), but don't
+ # spend more than 5 seconds doing this
set i 0
- while {[expr {$grabWin} $in_ni {[grab current]}] && $i < 500} {
+ while {![testgrab $type $grabWin] && $i < 500} {
after 10
update
incr i
@@ -6723,6 +6726,7 @@ test bind-35.1 {pointer warp with grab on master, bug [e3888d5820]} -setup {
after 50 ; # Win specific - wait for SendInput to be executed
toplevel .top
grab release .top
+ waitForGrab released .top
wm geometry .top 200x200+300+300
label .top.l -height 5 -width 20 -highlightthickness 2 \
-highlightbackground black -bg yellow -text "My label"
@@ -6730,14 +6734,14 @@ test bind-35.1 {pointer warp with grab on master, bug [e3888d5820]} -setup {
update
} -body {
grab .top ; # this will queue events
- waitForGrab .top ni
+ waitForGrab grabbed .top
event generate .top.l <Motion> -warp 1 -x 10 -y 10
update idletasks ; after 50
foreach {x1 y1} [winfo pointerxy .top.l] {}
event generate {} <Motion> -warp 1 -x 50 -y 50
update idletasks ; after 50
grab release .top ; # this will queue events
- waitForGrab .top in
+ waitForGrab released .top
event generate .top.l <Motion> -warp 1 -x 10 -y 10
update idletasks ; after 50
foreach {x2 y2} [winfo pointerxy .top.l] {}
diff --git a/tests/constraints.tcl b/tests/constraints.tcl
index c77fb00..49da142 100644
--- a/tests/constraints.tcl
+++ b/tests/constraints.tcl
@@ -207,6 +207,7 @@ testConstraint testcolor [llength [info commands testcolor]]
testConstraint testcursor [llength [info commands testcursor]]
testConstraint testembed [llength [info commands testembed]]
testConstraint testfont [llength [info commands testfont]]
+testConstraint testgrab [llength [info commands testgrab]]
testConstraint testmakeexist [llength [info commands testmakeexist]]
testConstraint testmenubar [llength [info commands testmenubar]]
testConstraint testmetrics [llength [info commands testmetrics]]