I've had similar problems restoring a complex application with several windows from a state. In 4.0.7 the z-order is remembered correctly, but in 4.1 it gets lost, and in fact the top most window is...