summaryrefslogtreecommitdiffstats
path: root/tests/bind.test
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2020-12-30 15:44:22 (GMT)
committerfvogel <fvogelnew1@free.fr>2020-12-30 15:44:22 (GMT)
commitd2f27b62c27ac652823ef07ddb066304472f4c29 (patch)
tree3112e501db8cd9648864bbe48f995e81fefdedd7 /tests/bind.test
parent887fa7cbc4d5fe7ff42a931604b4319278d858d8 (diff)
downloadtk-d2f27b62c27ac652823ef07ddb066304472f4c29.zip
tk-d2f27b62c27ac652823ef07ddb066304472f4c29.tar.gz
tk-d2f27b62c27ac652823ef07ddb066304472f4c29.tar.bz2
In Tk 8.7, warping is now synchronous (it was executed at idle time until and including 8.6), see [e3888d5820]. As a consequence we don't need to call 'update' in the tests anymore for 8.7. However, as detailed in ticket [69b48f427e] (specifically in comment there dated 2019-10-27 14:24:26), on Windows we still need to call 'after 50' to give time to SendInput to execute. This is independent from the fact warping happens sychronously or not and was committed as [e9becf44ab] in core-8-6-branch but was later erroneously removed from trunk branch in [d9d8c6bf] and [3e8ae688] under the wrong idea that is was not necessary with synchronous warping. Restore those calls, which makes bind-34.[123] and bind-36.1 always pass instead of rely on a race condition.
Diffstat (limited to 'tests/bind.test')
-rw-r--r--tests/bind.test12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/bind.test b/tests/bind.test
index ede1108..94a96fe 100644
--- a/tests/bind.test
+++ b/tests/bind.test
@@ -6247,6 +6247,7 @@ test bind-32.1 {-warp, window was destroyed before the idle callback DoWarp} -se
update
} -body {
event generate .t.f <Button-1> -warp 1
+ after 50 ; # Win specific - wait for SendInput to be executed
event generate .t.f <ButtonRelease-1>
destroy .t.f
update ; # shall simply not crash
@@ -6827,10 +6828,12 @@ test bind-34.1 {-warp works relatively to a window} -setup {
wm geometry .top +200+200
update
event generate .top <Motion> -x 20 -y 20 -warp 1
+ after 50 ; # Win specific - wait for SendInput to be executed
set pointerPos1 [winfo pointerxy .top]
wm geometry .top +600+600
update
event generate .top <Motion> -x 20 -y 20 -warp 1
+ after 50 ; # Win specific - wait for SendInput to be executed
set pointerPos2 [winfo pointerxy .top]
# from the first warped position to the second one, the mouse
# pointer should have moved the same amount as the window moved
@@ -6848,8 +6851,10 @@ test bind-34.2 {-warp works relatively to the screen} -setup {
} -body {
# Contrary to bind-34.1, we're directly checking screen coordinates
event generate {} <Motion> -x 20 -y 20 -warp 1
+ after 50 ; # Win specific - wait for SendInput to be executed
set res [winfo pointerxy .]
event generate {} <Motion> -x 200 -y 200 -warp 1
+ after 50 ; # Win specific - wait for SendInput to be executed
lappend res {*}[winfo pointerxy .]
} -cleanup {
} -result {20 20 200 200}
@@ -6867,6 +6872,7 @@ test bind-34.3 {-warp works with null or negative coordinates} -setup {
set res {}
} -body {
event generate {} <Motion> -x 0 -y 0 -warp 1
+ after 50 ; # Win specific - wait for SendInput to be executed
foreach dim [winfo pointerxy .] {
if {$dim <= $halo} {
lappend res ok
@@ -6875,7 +6881,9 @@ test bind-34.3 {-warp works with null or negative coordinates} -setup {
}
}
event generate {} <Motion> -x 100 -y 100 -warp 1
+ after 50 ; # Win specific - wait for SendInput to be executed
event generate {} <Motion> -x -1 -y -1 -warp 1
+ after 50 ; # Win specific - wait for SendInput to be executed
foreach dim [winfo pointerxy .] {
if {$dim <= $halo} {
lappend res ok
@@ -7020,6 +7028,7 @@ test bind-35.3 {Events agree for modifier keys} -constraints {aqua} -setup {
test bind-36.1 {pointer warp with grab on toplevel, bug [e3888d5820]} -setup {
event generate {} <Motion> -warp 1 -x 50 -y 50
+ after 50 ; # Win specific - wait for SendInput to be executed
toplevel .top
grab release .top
wm geometry .top 200x200+300+300
@@ -7035,10 +7044,13 @@ test bind-36.1 {pointer warp with grab on toplevel, bug [e3888d5820]} -setup {
} -body {
grab .top
event generate .top.l <Motion> -warp 1 -x 10 -y 10
+ after 50 ; # Win specific - wait for SendInput to be executed
foreach {x1 y1} [winfo pointerxy .top.l] {}
event generate {} <Motion> -warp 1 -x 50 -y 50
+ after 50 ; # Win specific - wait for SendInput to be executed
grab release .top
event generate .top.l <Motion> -warp 1 -x 10 -y 10
+ after 50 ; # Win specific - wait for SendInput to be executed
foreach {x2 y2} [winfo pointerxy .top.l] {}
# success if the coords are the same with or without the grab, and if they
# are at (10,10) inside the label widget as requested by the warping