summaryrefslogtreecommitdiffstats
path: root/tests/pack.test
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2022-11-01 17:49:39 (GMT)
committerfvogel <fvogelnew1@free.fr>2022-11-01 17:49:39 (GMT)
commit4c38bea33cb5de75b7b3738d56ed8da5ec8c9b68 (patch)
tree9af72b11bd95bd32bc359d95d287a30760d27bfd /tests/pack.test
parent2b3ee1c77ea11ee442210f100a64df0132cb27dd (diff)
downloadtk-4c38bea33cb5de75b7b3738d56ed8da5ec8c9b68.zip
tk-4c38bea33cb5de75b7b3738d56ed8da5ec8c9b68.tar.gz
tk-4c38bea33cb5de75b7b3738d56ed8da5ec8c9b68.tar.bz2
Split pack-18.1 into two tests and remove the tempNotWin constraint. pack-18.1.1 checks that, on Linux or macOS, width/height changes are taken into account while the window is unmapped ; pack-18.1.2 checks that, on Windows, width/height changes are taken into account on window remapping. This way we're at least checking correct sizes on Windows when the window gets remapped, while we weren't testing anything on Windows previously.
Diffstat (limited to 'tests/pack.test')
-rw-r--r--tests/pack.test39
1 files changed, 33 insertions, 6 deletions
diff --git a/tests/pack.test b/tests/pack.test
index a5e129d..4ba29f4 100644
--- a/tests/pack.test
+++ b/tests/pack.test
@@ -1551,8 +1551,17 @@ test pack-17.2 {PackLostContentProc procedure} -setup {
pack info .pack.a
} -returnCodes error -result {window ".pack.a" isn't packed}
-test pack-18.1 {unmap content when container unmapped} -constraints {
- tempNotWin failsOnUbuntu failsOnXQuarz
+# Test pack-18.1.* is constrained because on Windows, when the width/height
+# is configured while the window is unmapped, the changes don't take
+# effect until the window is remapped. This is apparently by design of the
+# OS, and Tk accommodates this behavior (see UpdateGeometryInfo() and
+# ConfigureTopLevel() in tkWinWm.c).
+# pack-18.1.1 checks that, on Linux or macOS, width/height changes are taken
+# into account while the window is unmapped.
+# pack-18.1.2 checks that, on Windows, width/height changes are taken into
+# account on window remapping.
+test pack-18.1.1 {unmap content when container unmapped} -constraints {
+ macOrUnix failsOnUbuntu failsOnXQuarz
} -setup {
eval destroy [winfo child .pack]
# adjust the position of .pack before test to avoid a screen switch
@@ -1560,10 +1569,6 @@ test pack-18.1 {unmap content when container unmapped} -constraints {
# as the screen (screen switch causes scale and other tests to fail).
wm geometry .pack +100+100
} -body {
- # Test constrained by tempNotWin because on Windows, when the width/height
- # is configured while the window is unmapped, the changes don't take
- # effect until the window is remapped. Who knows why?
-
frame .pack.a -width 100 -height 50 -relief raised -bd 2
pack .pack.a
update
@@ -1578,6 +1583,28 @@ test pack-18.1 {unmap content when container unmapped} -constraints {
update
lappend result [winfo ismapped .pack.a]
} -result {1 0 200 75 0 1}
+test pack-18.1.2 {unmap content when container unmapped} -constraints {
+ win
+} -setup {
+ eval destroy [winfo child .pack]
+ # adjust the position of .pack before test to avoid a screen switch
+ # that occurs with window managers that have desktops four times as big
+ # as the screen (screen switch causes scale and other tests to fail).
+ wm geometry .pack +100+100
+} -body {
+ frame .pack.a -width 100 -height 50 -relief raised -bd 2
+ pack .pack.a
+ update
+ set result [winfo ismapped .pack.a]
+ wm iconify .pack
+ lappend result [winfo ismapped .pack.a]
+ .pack.a configure -width 200 -height 75
+ update
+ wm deiconify .pack
+ update
+ lappend result [winfo width .pack.a] [winfo height .pack.a]
+ lappend result [winfo ismapped .pack.a]
+} -result {1 0 200 75 1}
test pack-18.2 {unmap content when container unmapped} -constraints {failsOnUbuntu failsOnXQuarz} -setup {
eval destroy [winfo child .pack]