Enabled MainWindow to be specified, not just default to first frame launched.