diff options
author | culler <culler> | 2019-02-13 21:02:34 (GMT) |
---|---|---|
committer | culler <culler> | 2019-02-13 21:02:34 (GMT) |
commit | 3469df6a780ed8f083665cbfdaca79453da2e982 (patch) | |
tree | fd5862570d68acab47ce7de6e5e81a037962ed13 /tests/unixWm.test | |
parent | bf53ad5c9a0de20d1a9952aecd213c2d0432ebb3 (diff) | |
parent | fa6377112a54cd65d14f6ed2559ac26b684fdbb8 (diff) | |
download | tk-3469df6a780ed8f083665cbfdaca79453da2e982.zip tk-3469df6a780ed8f083665cbfdaca79453da2e982.tar.gz tk-3469df6a780ed8f083665cbfdaca79453da2e982.tar.bz2 |
Fix bug [2249e64bdc]: adjust unixWm tests which expect impossible results on Aqua.
Diffstat (limited to 'tests/unixWm.test')
-rw-r--r-- | tests/unixWm.test | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/tests/unixWm.test b/tests/unixWm.test index 826cd72..28c8159 100644 --- a/tests/unixWm.test +++ b/tests/unixWm.test @@ -40,8 +40,23 @@ proc makeToplevels {} { } } +# On macOS windows are not allowed to overlap the menubar at the top +# of the screen. So tests which move a window and then check whether +# it got moved to the requested location should use a y coordinate +# larger than the height of the menubar (normally 23 pixels). + +if {[tk windowingsystem] eq "aqua"} { + set Y0 23 + set Y2 25 + set Y5 28 +} else { + set Y0 0 + set Y2 2 + set Y5 5 +} + set i 1 -foreach geom {+20+80 +80+20 +0+0} { +foreach geom "+23+80 +80+23 +0+$Y0" { destroy .t test unixWm-1.$i {initial window position} unix { toplevel .t -width 200 -height 150 @@ -67,7 +82,7 @@ update scan [wm geom .t] %dx%d+%d+%d width height x y set xerr [expr 150-$x] set yerr [expr 150-$y] -foreach geom {+20+80 +80+20 +0+0 -0-0 +0-0 -0+0 -10-5 -10+5 +10-5} { +foreach geom "+20+80 +80+23 +0+$Y0 -0-0 +0-0 -0+$Y0 -10-5 -10+$Y5 +10-5" { test unixWm-2.$i {moving window while mapped} unix { wm geom .t $geom update @@ -79,7 +94,7 @@ foreach geom {+20+80 +80+20 +0+0 -0-0 +0-0 -0+0 -10-5 -10+5 +10-5} { } set i 1 -foreach geom {+20+80 +80+20 +0+0 -0-0 +0-0 -0+0 -10-5 -10+5 +10-5} { +foreach geom "+20+80 +80+23 +0+$Y0 -0-0 +0-0 -0+$Y0 -10-5 -10+$Y5 +10-5" { test unixWm-3.$i {moving window while iconified} unix { wm iconify .t sleep 200 @@ -95,7 +110,7 @@ foreach geom {+20+80 +80+20 +0+0 -0-0 +0-0 -0+0 -10-5 -10+5 +10-5} { } set i 1 -foreach geom {+20+80 +100+40 +0+0} { +foreach geom "+20+80 +100+40 +0+$Y0" { test unixWm-4.$i {moving window while withdrawn} unix { wm withdraw .t sleep 200 @@ -179,27 +194,27 @@ test unixWm-5.7 {compounded state changes} {unix nonPortable} { destroy .t toplevel .t -width 200 -height 100 -wm geom .t +10+10 +wm geom .t +10+23 wm minsize .t 1 1 update test unixWm-6.1 {size changes} unix { .t config -width 180 -height 150 update wm geom .t -} 180x150+10+10 +} 180x150+10+23 test unixWm-6.2 {size changes} unix { wm geom .t 250x60 .t config -width 170 -height 140 update wm geom .t -} 250x60+10+10 +} 250x60+10+23 test unixWm-6.3 {size changes} unix { wm geom .t 250x60 .t config -width 170 -height 140 wm geom .t {} update wm geom .t -} 170x140+10+10 +} 170x140+10+23 test unixWm-6.4 {size changes} {unix nonPortable userInteraction} { wm minsize .t 1 1 update @@ -1357,14 +1372,14 @@ test unixWm-40.1 {Tk_SetGrid procedure, set grid dimensions before turning on gr test unixWm-40.2 {Tk_SetGrid procedure, turning on grid when dimensions already set} unix { destroy .t toplevel .t - wm geometry .t 200x100+0+0 + wm geometry .t 200x100+0+$Y0 listbox .t.l -height 20 -width 20 pack .t.l -fill both -expand 1 update .t.l configure -setgrid 1 update wm geometry .t -} {20x20+0+0} +} "20x20+0+$Y0" test unixWm-41.1 {ConfigureEvent procedure, internally generated size changes} unix { destroy .t @@ -1559,10 +1574,10 @@ test unixWm-44.8 {UpdateGeometryInfo procedure, computing position} unix { tkwait visibility .t wm overrideredirect .t 1 update - wm geometry .t -30+2 + wm geometry .t -30+$Y2 update list [winfo x .t] [winfo y .t] -} [list [expr [winfo screenwidth .t] - 110] 2] +} [list [expr [winfo screenwidth .t] - 110] $Y2] destroy .t test unixWm-44.9 {UpdateGeometryInfo procedure, updating fixed dimensions} {unix testwrapper} { |