Pārlūkot izejas kodu

UI: Fix wrong program scene if tbar is aborted

The program scene would be incorrect if the tbar was released
at its original position.
cg2121 2 gadi atpakaļ
vecāks
revīzija
03a94aee41
2 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. 1 2
      UI/window-basic-main-transitions.cpp
  2. 1 0
      UI/window-basic-main.hpp

+ 1 - 2
UI/window-basic-main-transitions.cpp

@@ -309,8 +309,6 @@ void OBSBasic::TransitionToScene(OBSSource source, bool force,
 	if (!scene)
 		return;
 
-	OBSWeakSource lastProgramScene;
-
 	if (usingPreviewProgram) {
 		if (!tBarActive)
 			lastProgramScene = programScene;
@@ -906,6 +904,7 @@ void OBSBasic::TBarReleased()
 		tBar->blockSignals(false);
 		tBarActive = false;
 		EnableTransitionWidgets(true);
+		programScene = lastProgramScene;
 	}
 
 	tBar->clearFocus();

+ 1 - 0
UI/window-basic-main.hpp

@@ -497,6 +497,7 @@ private:
 	OBSWeakSource lastScene;
 	OBSWeakSource swapScene;
 	OBSWeakSource programScene;
+	OBSWeakSource lastProgramScene;
 	bool editPropertiesMode = false;
 	bool sceneDuplicationMode = true;
 	bool swapScenesMode = true;