Skip to content

Commit

Permalink
(cherry-pick): Fix wm-stackorder-2.3 on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jan.nijtmans committed Oct 18, 2024
1 parent b288315 commit ff870b2
Showing 1 changed file with 38 additions and 30 deletions.
68 changes: 38 additions & 30 deletions tests/wm.test
Original file line number Diff line number Diff line change
Expand Up @@ -553,15 +553,15 @@ test wm-deiconify-1.6 {usage} -constraints !win -setup {

deleteWindows
test wm-deiconify-2.1 {a window that has never been mapped\
should not be mapped by a call to deiconify} -body {
should not be mapped by a call to deiconify} -body {
toplevel .t
wm deiconify .t
winfo ismapped .t
} -cleanup {
deleteWindows
} -result 0
test wm-deiconify-2.2 {a window that has already been\
mapped should be mapped by deiconify} -body {
mapped should be mapped by deiconify} -body {
toplevel .t
update idletasks
wm withdraw .t
Expand All @@ -571,8 +571,8 @@ test wm-deiconify-2.2 {a window that has already been\
deleteWindows
} -result 1
test wm-deiconify-2.3 {geometry for an unmapped window\
should not be calculated by a call to deiconify,\
it should be done at idle time} -setup {
should not be calculated by a call to deiconify,\
it should be done at idle time} -setup {
set results {}
} -body {
toplevel .t -width 200 -height 200
Expand All @@ -581,13 +581,13 @@ test wm-deiconify-2.3 {geometry for an unmapped window\
lappend results [wm geometry .t]
update idletasks
lappend results [lindex [split \
[wm geometry .t] +] 0]
[wm geometry .t] +] 0]
} -cleanup {
deleteWindows
} -result {1x1+0+0 1x1+0+0 200x200}
test wm-deiconify-2.4 {invoking destroy after a deiconify\
should not result in a crash because of a callback\
set on the toplevel} -body {
should not result in a crash because of a callback\
set on the toplevel} -body {
toplevel .t
wm withdraw .t
wm deiconify .t
Expand Down Expand Up @@ -944,6 +944,8 @@ test wm-iconwindow-1.5 {usage} -setup {
} -result {.icon is already an icon for .t2}

test wm-iconwindow-2.1 {setting and reading values} -setup {
# without this macOS crashes for unknown reasons
wm iconwindow .t {}
destroy .icon
set result {}
} -body {
Expand Down Expand Up @@ -996,7 +998,7 @@ test wm-maxsize-1.7 {maxsize must be <= screen size} -setup {

destroy .t
test wm-maxsize-2.1 {setting the maxsize to a value smaller\
than the current size will resize a toplevel} -body {
than the current size will resize a toplevel} -body {
toplevel .t -width 300 -height 300
update
wm maxsize .t 200 150
Expand All @@ -1007,7 +1009,7 @@ test wm-maxsize-2.1 {setting the maxsize to a value smaller\
destroy .t
} -result {200 150}
test wm-maxsize-2.2 {setting the maxsize to a value smaller\
than the current size will resize a gridded toplevel} -body {
than the current size will resize a gridded toplevel} -body {
toplevel .t
wm grid .t 0 0 50 50
wm geometry .t 6x6
Expand All @@ -1020,7 +1022,7 @@ test wm-maxsize-2.2 {setting the maxsize to a value smaller\
destroy .t
} -result {4 3}
test wm-maxsize-2.3 {attempting to resize to a value\
bigger than the current maxsize will set it to the max size} -body {
bigger than the current maxsize will set it to the max size} -body {
toplevel .t -width 200 -height 200
wm maxsize .t 300 250
update
Expand Down Expand Up @@ -1084,7 +1086,7 @@ test wm-minsize-1.6 {usage} -setup {
} -result {300 200}

test wm-minsize-2.1 {setting the minsize to a value larger\
than the current size will resize a toplevel} -body {
than the current size will resize a toplevel} -body {
toplevel .t -width 200 -height 200
update
wm minsize .t 400 300
Expand All @@ -1095,7 +1097,7 @@ test wm-minsize-2.1 {setting the minsize to a value larger\
destroy .t
} -result {400 300}
test wm-minsize-2.2 {setting the minsize to a value larger\
than the current size will resize a gridded toplevel} -body {
than the current size will resize a gridded toplevel} -body {
toplevel .t
wm grid .t 1 1 50 50
wm geom .t 4x4
Expand All @@ -1108,7 +1110,7 @@ test wm-minsize-2.2 {setting the minsize to a value larger\
destroy .t
} -result {8 8}
test wm-minsize-2.3 {attempting to resize to a value\
smaller than the current minsize will set it to the minsize} -body {
smaller than the current minsize will set it to the minsize} -body {
toplevel .t -width 400 -height 400
wm minsize .t 300 300
update
Expand Down Expand Up @@ -1362,18 +1364,24 @@ test wm-stackorder-2.2 {stacking order} -body {
destroy .t
} -result {.t .}
test wm-stackorder-2.3 {stacking order} -body {
set res {}
toplevel .t
tkwait visibility .t
raiseDelay
toplevel .t2
tkwait visibility .t2
raiseDelay
lappend res [wm stackorder .]
raise .
raiseDelay
lappend res [wm stackorder .]
raise .t2
raiseDelay
wm stackorder .
lappend res [wm stackorder .]
set res
} -cleanup {
destroy .t .t2
} -result {.t . .t2}
} -result {. .t .t2} {.t .t2 .} {.t . .t2}
test wm-stackorder-2.4 {stacking order} -body {
toplevel .t ; update
toplevel .t2 ; update
Expand Down Expand Up @@ -1562,7 +1570,7 @@ test wm-stackorder-5.2.1 {A normal toplevel can be raised above an \
destroy .t
} -result 1
test wm-stackorder-5.3 {An overrideredirect window\
can be explicitly lowered} -body {
can be explicitly lowered} -body {
toplevel .t
wm overrideredirect .t 1
tkwait visibility .t
Expand Down Expand Up @@ -1695,7 +1703,7 @@ test wm-transient-2.2 {first toplevel parent of non-toplevel container window is
} -result {.top}

test wm-transient-3.1 {transient toplevel is withdrawn
when mapped if toplevel is withdrawn} -body {
when mapped if toplevel is withdrawn} -body {
toplevel .top
wm withdraw .top
update
Expand All @@ -1707,7 +1715,7 @@ test wm-transient-3.1 {transient toplevel is withdrawn
deleteWindows
} -result {withdrawn 0}
test wm-transient-3.2 {already mapped transient toplevel
takes on withdrawn state of toplevel} -body {
takes on withdrawn state of toplevel} -body {
toplevel .top
wm withdraw .top
update
Expand All @@ -1720,7 +1728,7 @@ test wm-transient-3.2 {already mapped transient toplevel
deleteWindows
} -result {withdrawn 0}
test wm-transient-3.3 {withdraw/deiconify on the toplevel
also does a withdraw/deiconify on the transient} -setup {
also does a withdraw/deiconify on the transient} -setup {
set results [list]
} -body {
toplevel .top
Expand All @@ -1738,7 +1746,7 @@ test wm-transient-3.3 {withdraw/deiconify on the toplevel
} -result {withdrawn 0 normal 1}

test wm-transient-4.1 {transient toplevel is withdrawn
when mapped if toplevel is iconic} -constraints {failsOnUbuntu failsOnXQuarz} -body {
when mapped if toplevel is iconic} -constraints {failsOnUbuntu failsOnXQuarz} -body {
toplevel .top
wm iconify .top
update
Expand All @@ -1750,7 +1758,7 @@ test wm-transient-4.1 {transient toplevel is withdrawn
deleteWindows
} -result {withdrawn 0}
test wm-transient-4.2 {already mapped transient toplevel
is withdrawn if toplevel is iconic} -constraints {failsOnUbuntu failsOnXQuarz} -body {
is withdrawn if toplevel is iconic} -constraints {failsOnUbuntu failsOnXQuarz} -body {
toplevel .top
raiseDelay
wm iconify .top
Expand All @@ -1764,7 +1772,7 @@ test wm-transient-4.2 {already mapped transient toplevel
deleteWindows
} -result {withdrawn 0}
test wm-transient-4.3 {iconify/deiconify on the toplevel
does a withdraw/deiconify on the transient} -constraints {failsOnUbuntu failsOnXQuarz} -setup {
does a withdraw/deiconify on the transient} -constraints {failsOnUbuntu failsOnXQuarz} -setup {
set results [list]
} -body {
toplevel .top
Expand All @@ -1782,7 +1790,7 @@ test wm-transient-4.3 {iconify/deiconify on the toplevel
} -result {withdrawn 0 normal 1}

test wm-transient-5.1 {an error during transient command should not
cause the map/unmap binding to be deleted} -setup {
cause the map/unmap binding to be deleted} -setup {
set results [list]
} -body {
toplevel .top
Expand All @@ -1801,7 +1809,7 @@ test wm-transient-5.1 {an error during transient command should not
deleteWindows
} -result {1 withdrawn normal}
test wm-transient-5.2 {remove transient property when toplevel
is destroyed} -body {
is destroyed} -body {
toplevel .top
toplevel .subject
wm transient .subject .top
Expand All @@ -1813,7 +1821,7 @@ test wm-transient-5.2 {remove transient property when toplevel
deleteWindows
} -result {}
test wm-transient-5.3 {remove transient property from window
that had never been mapped when toplevel is destroyed} -body {
that had never been mapped when toplevel is destroyed} -body {
toplevel .top
toplevel .subject
wm transient .subject .top
Expand All @@ -1824,7 +1832,7 @@ test wm-transient-5.3 {remove transient property from window
} -result {}

test wm-transient-6.1 {a withdrawn transient does not track
state changes in the toplevel} -body {
state changes in the toplevel} -body {
toplevel .top
toplevel .subject
update
Expand All @@ -1839,7 +1847,7 @@ test wm-transient-6.1 {a withdrawn transient does not track
deleteWindows
} -result {withdrawn}
test wm-transient-6.2 {a withdrawn transient does not track
state changes in the toplevel} -setup {
state changes in the toplevel} -setup {
set results [list]
} -body {
toplevel .top
Expand All @@ -1864,7 +1872,7 @@ test wm-transient-6.2 {a withdrawn transient does not track
deleteWindows
} -result {withdrawn normal withdrawn normal}
test wm-transient-6.3 {a withdrawn transient does not track
state changes in the toplevel} -body {
state changes in the toplevel} -body {
toplevel .top
toplevel .subject
update
Expand Down Expand Up @@ -1921,7 +1929,7 @@ test wm-transient-7.4 {Reassign transient, destroy new toplevel} -body {
toplevel .transient
wm transient .transient .t1
wm transient .transient .t2
destroy .t2 ;# caused panic in 8.4b1
destroy .t2 ;# caused panic in 8.4b1
destroy .t1
destroy .transient
} -cleanup {
Expand All @@ -1934,7 +1942,7 @@ test wm-transient-7.5 {Reassign transient, destroy transient} -body {
wm transient .transient .t1
wm transient .transient .t2
destroy .transient
destroy .t2 ;# caused panic in 8.4b1
destroy .t2 ;# caused panic in 8.4b1
destroy .t1 ;# so did this
} -cleanup {
deleteWindows
Expand Down

0 comments on commit ff870b2

Please sign in to comment.