summaryrefslogtreecommitdiffstats
path: root/tests/unixWm.test
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/unixWm.test
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/unixWm.test')
-rw-r--r--tests/unixWm.test50
1 files changed, 40 insertions, 10 deletions
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"} {