Save main window geometry only when really needed