summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
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]]