save/restore position and size on exit