summaryrefslogtreecommitdiffstats
path: root/tests/unixWm.test
diff options
context:
space:
mode:
authorculler <culler>2022-10-08 21:27:01 (GMT)
committerculler <culler>2022-10-08 21:27:01 (GMT)
commit96b66d43c7d89c8cff44d9768c2d57bd4b4a7cdf (patch)
tree2a60efd65b5464746e86da2c818c7daf75a6ea2d /tests/unixWm.test
parent444c87737026a16a49959ef71a6d5c5f1a8cbbdd (diff)
parentad6d5ee2edbdcabf0d5beabf5170dd36ba7d1a55 (diff)
downloadtk-96b66d43c7d89c8cff44d9768c2d57bd4b4a7cdf.zip
tk-96b66d43c7d89c8cff44d9768c2d57bd4b4a7cdf.tar.gz
tk-96b66d43c7d89c8cff44d9768c2d57bd4b4a7cdf.tar.bz2
Merge 8.6
Diffstat (limited to 'tests/unixWm.test')
-rw-r--r--tests/unixWm.test44
1 files changed, 35 insertions, 9 deletions
diff --git a/tests/unixWm.test b/tests/unixWm.test
index c103253..a1058b9 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,16 @@ 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
raise .t2
+ restackDelay
set x [winfo rootx .t]
set y [winfo rooty .t]
set y2 [winfo rooty .t2]
@@ -1879,12 +1893,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,11 +1982,13 @@ 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
+ wm geometry .t +0+0
+ update idletasks
toplevel .t2 -width 200 -height 200 -bg red
- wm geometry .t2 +0+0
tkwait visibility .t2
+ wm geometry .t2 +0+0
+ restackDelay
set result [list [winfo containing 100 100]]
wm iconify .t2
update idletasks
@@ -2048,24 +2065,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 +2100,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 +2111,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 +2132,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 +2144,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"} {