resize_monitor default 800 600
add_monitor secondary 800 600
move_cursor_to 900 100
set_pref center-new-windows true

new_client w wayland
new_client x x11

#
# Minimize maximized window, unminimize should restore to the same state.
#

# Wayland
create w/1 csd
maximize w/1
show w/1
assert_size w/1 800 600
assert_position w/1 800 0
assert_stacking_showing w/1

minimize w/1
wait
assert_stacking_showing

local_activate w/1
wait
assert_size w/1 800 600
assert_position w/1 800 0
assert_stacking w/1
destroy w/1

# X11
create x/1 csd
maximize x/1
show x/1
assert_size x/1 800 600
assert_position x/1 800 0
assert_stacking_showing x/1

minimize x/1
wait
assert_stacking_showing

local_activate x/1
wait
assert_size x/1 800 600
assert_position x/1 800 0
assert_stacking x/1
destroy x/1

#
# Minimize maximized window, unmaximize, then unminimize should calculate
# correct position.
#

# Wayland
create w/2 csd
resize w/2 200 200
maximize w/2
show w/2
assert_size w/2 800 600
assert_position w/2 800 0
assert_stacking_showing w/2

minimize w/2
wait
assert_stacking_showing

unmaximize w/2
wait_reconfigure w/2
assert_stacking_showing

local_activate w/2
assert_stacking_showing w/2
assert_size w/2 200 200
assert_position w/2 1100 200
destroy w/2

# X11
create x/2 csd
resize x/2 200 200
maximize x/2
show x/2
assert_size x/2 800 600
assert_position x/2 800 0
assert_stacking_showing x/2

minimize x/2
wait
assert_stacking_showing

unmaximize x/2
wait_reconfigure x/2
assert_stacking_showing

local_activate x/2
assert_stacking_showing x/2
assert_size x/2 200 200
assert_position x/2 1100 200
destroy x/2
