Set the orientation before showing the main window.