Save and restore the window position