summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorculler <culler>2022-10-10 21:24:41 (GMT)
committerculler <culler>2022-10-10 21:24:41 (GMT)
commit32f38b272a187d02799d611c3b4b8232330e3b39 (patch)
tree0336b2eedb073bce2626971671d413ee2cd6b23e /tests
parent5a64bed54b2c6a377a74941a0c09c4324c9cf878 (diff)
downloadtk-32f38b272a187d02799d611c3b4b8232330e3b39.zip
tk-32f38b272a187d02799d611c3b4b8232330e3b39.tar.gz
tk-32f38b272a187d02799d611c3b4b8232330e3b39.tar.bz2
Add a few other adjustments to unstable_tests
Diffstat (limited to 'tests')
-rw-r--r--tests/unixEmbed.test20
-rw-r--r--tests/unixWm.test50
2 files changed, 50 insertions, 20 deletions
diff --git a/tests/unixEmbed.test b/tests/unixEmbed.test
index 669ef40..0981668 100644
--- a/tests/unixEmbed.test
+++ b/tests/unixEmbed.test
@@ -1263,6 +1263,7 @@ test unixEmbed-10.2 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} -con
} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
+ update
toplevel .t1 -use [winfo id .f1] -width 150 -height 80
update
wm geometry .t1 70x300+10+20
@@ -1293,30 +1294,29 @@ test unixEmbed-11.2 {mouse coordinates in embedded toplevels} -constraints {
} -setup {
deleteWindows
} -body {
+ set result {}
toplevel .main
+ update
+ frame .main.f -container 1 -width 200 -height 200
+ button .main.b -text "Main Button" -command {lappend result "pushed .main.b"}
wm geometry .main 200x400+100+100
- set result {}
- pack [button .main.b -text "Main Button" \
- -command {lappend result "pushed .main.b"}] -padx 30 -pady 30
- pack [frame .main.f -container 1 -width 200 -height 200] -fill both
+ pack .main.f -fill both
+ pack .main.b -padx 30 -pady 30
update
toplevel .embed -use [winfo id .main.f] -bg green
- update
- pack [button .embed.b -text "Emb Button" \
- -command {lappend result "pushed .embed.b"}] -padx 30 -pady 30
+ button .embed.b -text "Emb Button" -command {lappend result "pushed .embed.b"}
+ pack .embed.b -padx 30 -pady 30
update
focus -force .main
- after 100
+ update
set x [expr {[winfo rootx .main.b] + [winfo width .main.b]/2}]
set y [expr {[winfo rooty .main.b] + [winfo height .main.b]/2}]
lappend result [winfo containing $x $y]
- after 200
pressbutton $x $y
update
set x [expr {[winfo rootx .embed.b] + [winfo width .embed.b]/2}]
set y [expr {[winfo rooty .embed.b] + [winfo height .embed.b]/2}]
lappend result [winfo containing $x $y]
- after 200
pressbutton $x $y
update
set result
diff --git a/tests/unixWm.test b/tests/unixWm.test
index 4f94cc1..af6451c 100644
--- a/tests/unixWm.test
+++ b/tests/unixWm.test
@@ -16,6 +16,17 @@ namespace import -force ::tk::test:loadTkCommand
testConstraint failsOnUbuntu [expr {![info exists ::env(CI)] || ![string match Linux $::tcl_platform(os)]}]
testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowingsystem] ne "x11" }]
+# Starting with macOS Ventura it became necessary to wait for windows to be restacked
+# or to be raised after creation.
+
+if {[tk windowingsystem] == "aqua"} {
+ proc restackDelay {} {
+ after 100;
+ }
+} else {
+ proc restackDelay {} {}
+}
+
proc sleep ms {
global x
after $ms {set x 1}
@@ -1823,13 +1834,17 @@ test unixWm-50.1 {Tk_CoordsToWindow procedure, finding a toplevel, x-coords, tit
test unixWm-50.2 {Tk_CoordsToWindow procedure, finding a toplevel, y-coords and overrideredirect} unix {
deleteWindows
toplevel .t -width 400 -height 300 -bg yellow
- wm geom .t +100+100
tkwait visibility .t
+ wm geom .t +100+100
+ update
+ restackDelay
toplevel .t2 -width 200 -height 100 -bg blue
+ tkwait visibility .t2
wm overrideredirect .t2 1
wm geom .t2 +200+200
- tkwait visibility .t2
+ update
raise .t2
+ restackDelay
set x [winfo rootx .t]
set y [winfo rooty .t]
set y2 [winfo rooty .t2]
@@ -1879,12 +1894,13 @@ test unixWm-50.4 {Tk_CoordsToWindow procedure, window in other application} unix
catch {interp delete child}
toplevel .t -width 200 -height 200 -bg green
- wm geometry .t +100+100
tkwait visibility .t
+ wm geometry .t +100+100
update
interp create child
load {} Tk child
- child eval {wm geometry . 200x200+100+100; tkwait visibility . ; update}
+ child eval {wm geometry . 200x200+100+100; update}
+ restackDelay
set result [list [winfo containing 200 200] \
[child eval {winfo containing 200 200}]]
interp delete child
@@ -1967,14 +1983,19 @@ test unixWm-50.9 {Tk_CoordsToWindow procedure, unmapped windows} {unix failsOnUb
destroy .t
destroy .t2
toplevel .t -width 200 -height 200 -bg green
- wm geometry .t +0+0
tkwait visibility .t
+ update
+ wm geometry .t +0+0
+ update
toplevel .t2 -width 200 -height 200 -bg red
- wm geometry .t2 +0+0
tkwait visibility .t2
+ update
+ wm geometry .t2 +0+0
+ update
+ restackDelay
set result [list [winfo containing 100 100]]
wm iconify .t2
- update idletasks
+ update
lappend result [winfo containing 100 100]
} {.t2 .t}
test unixWm-50.10 {Tk_CoordsToWindow procedure, unmapped windows} unix {
@@ -2048,24 +2069,28 @@ deleteWindows
test unixWm-51.6 {TkWmRestackToplevel procedure, window to be stacked isn't mapped} unix {
destroy .t
toplevel .t -width 200 -height 200 -bg green
- wm geometry .t +0+0
tkwait visibility .t
+ wm geometry .t +0+0
+ update
+ restackDelay
destroy .t2
toplevel .t2 -width 200 -height 200 -bg red
- wm geometry .t2 +0+0
+ # This test assumes that .t2 is not mapped yet, but that is not really guaranteed.
winfo containing 100 100
} {.t}
test unixWm-51.7 {TkWmRestackToplevel procedure, other window isn't mapped} {unix failsOnXQuarz} {
foreach w {.t .t2 .t3} {
destroy $w
- update
toplevel $w -width 200 -height 200 -bg green
wm geometry $w +0+0
+ update
}
raise .t .t2
+ restackDelay
update
set result [list [winfo containing 100 100]]
lower .t3
+ restackDelay
lappend result [winfo containing 100 100]
} {.t3 .t}
test unixWm-51.8 {TkWmRestackToplevel procedure, overrideredirect windows} unix {
@@ -2079,6 +2104,7 @@ test unixWm-51.8 {TkWmRestackToplevel procedure, overrideredirect windows} unix
wm overrideredirect .t2 1
wm geometry .t2 +0+0
tkwait visibility .t2
+ restackDelay
# Need to use vrootx and vrooty to make tests work correctly with
# virtual root window measures managers: overrideredirect windows
@@ -2089,8 +2115,10 @@ test unixWm-51.8 {TkWmRestackToplevel procedure, overrideredirect windows} unix
set y [expr 100-[winfo vrooty .]]
set result [list [winfo containing $x $y]]
raise .t
+ restackDelay
lappend result [winfo containing $x $y]
raise .t2
+ restackDelay
lappend result [winfo containing $x $y]
} {.t2 .t .t2}
# The mac won't put an overrideredirect window above the root,
@@ -2108,6 +2136,7 @@ test unixWm-51.9 {TkWmRestackToplevel procedure, other window overrideredirect}
update
}
lower .t3 .t2
+ restackDelay
update
# Need to use vrootx and vrooty to make tests work correctly with
@@ -2119,6 +2148,7 @@ test unixWm-51.9 {TkWmRestackToplevel procedure, other window overrideredirect}
set y [expr 100-[winfo vrooty .]]
set result [list [winfo containing $x $y]]
lower .t2
+ restackDelay
lappend result [winfo containing $x $y]
} {.t2 .t3}
if {[tk windowingsystem] == "aqua"} {