From 8328609b209ef962cf10a8fb09c56bf0085f1a49 Mon Sep 17 00:00:00 2001 From: gxalpha Date: Wed, 18 May 2022 12:48:27 +0200 Subject: [PATCH] UI: Don't transition in studio mode if scenes are the same Fixes an issue where when "Duplicate Scenes" and "Switch Preview/Program after Transitioning" were disabled and preview and program were the same scene, pressing "Transition" would just disable the menus without anything happening. This is because a transition is initiated, but never actually starts transitioning (since both scenes are the same). The check for this already exists, but was only triggered in swapScenesMode. Also renames the newScene variable to lastScene to make it more obvious what it actually is (especially since now, it's not only the new scene anymore). --- UI/window-basic-main-transitions.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/UI/window-basic-main-transitions.cpp b/UI/window-basic-main-transitions.cpp index bcb1fbe0b..bb9a3e290 100644 --- a/UI/window-basic-main-transitions.cpp +++ b/UI/window-basic-main-transitions.cpp @@ -359,13 +359,14 @@ void OBSBasic::TransitionToScene(OBSSource source, bool force, lastProgramScene = programScene; programScene = OBSGetWeakRef(source); - if (swapScenesMode && !force && !black) { - OBSSource newScene = OBSGetStrongRef(lastProgramScene); + if (!force && !black) { + OBSSource lastScene = OBSGetStrongRef(lastProgramScene); - if (!sceneDuplicationMode && newScene == source) + if (!sceneDuplicationMode && lastScene == source) return; - if (newScene && newScene != GetCurrentSceneSource()) + if (swapScenesMode && lastScene && + lastScene != GetCurrentSceneSource()) swapScene = lastProgramScene; } }