macosx: fix main window positioning on startup (close #9818)