new_client 2 x11
create 2/1
show 2/1

new_client 1 x11
create 1/1
show 1/1

create 1/2 csd
set_parent 1/2 1
accept_focus 1/2 false
show 1/2

create 1/3 csd
set_parent 1/3 2
show 1/3

wait
assert_focused 1/3
assert_stacking 2/1 1/1 1/2 1/3

destroy 1/3
wait

assert_stacking 2/1 1/1 1/2

activate 2/1
wait

assert_focused 2/1
assert_stacking 1/1 1/2 2/1

sleep 250
wait

assert_focused 2/1
assert_stacking 1/1 1/2 2/1
