Browse Source

UI: Initialize Studio mode after loading scenes

Switching to Studio mode tries to duplicate the current scene, which is
null until scenes are loaded, generating various errors.
Richard Stanway 4 years ago
parent
commit
8b50ad5e2a
1 changed files with 9 additions and 9 deletions
  1. 9 9
      UI/window-basic-main.cpp

+ 9 - 9
UI/window-basic-main.cpp

@@ -1824,15 +1824,6 @@ void OBSBasic::OBSInit()
 	editPropertiesMode = config_get_bool(
 		App()->GlobalConfig(), "BasicWindow", "EditPropertiesMode");
 
-	if (!opt_studio_mode) {
-		SetPreviewProgramMode(config_get_bool(App()->GlobalConfig(),
-						      "BasicWindow",
-						      "PreviewProgramMode"));
-	} else {
-		SetPreviewProgramMode(true);
-		opt_studio_mode = false;
-	}
-
 #define SET_VISIBILITY(name, control)                                         \
 	do {                                                                  \
 		if (config_has_user_value(App()->GlobalConfig(),              \
@@ -1868,6 +1859,15 @@ void OBSBasic::OBSInit()
 	TimedCheckForUpdates();
 	loaded = true;
 
+	if (!opt_studio_mode) {
+		SetPreviewProgramMode(config_get_bool(App()->GlobalConfig(),
+						      "BasicWindow",
+						      "PreviewProgramMode"));
+	} else {
+		SetPreviewProgramMode(true);
+		opt_studio_mode = false;
+	}
+
 	previewEnabled = config_get_bool(App()->GlobalConfig(), "BasicWindow",
 					 "PreviewEnabled");