From 78fa18f22a93ff2a9c4d169a346c679cf4b7ffb0 Mon Sep 17 00:00:00 2001 From: WarmUpTill Date: Thu, 16 Aug 2018 12:28:10 +0200 Subject: [PATCH] prevent idle switch loop when using previous scene as target --- idle-switch.cpp | 5 +++++ switcher-data-structs.hpp | 1 + 2 files changed, 6 insertions(+) diff --git a/idle-switch.cpp b/idle-switch.cpp index e8ff2796..99a12918 100644 --- a/idle-switch.cpp +++ b/idle-switch.cpp @@ -41,10 +41,15 @@ void SwitcherData::checkIdleSwitch(bool& match, OBSWeakSource& scene, OBSWeakSou if (!ignoreIdle && secondsSinceLastInput() > idleData.time) { + if (idleData.alreadySwitched) + return; scene = (idleData.usePreviousScene) ? previousScene : idleData.scene; transition = idleData.transition; match = true; + idleData.alreadySwitched = true; } + else + idleData.alreadySwitched = false; } void SceneSwitcher::on_idleCheckBox_stateChanged(int state) diff --git a/switcher-data-structs.hpp b/switcher-data-structs.hpp index a790654b..f145a202 100644 --- a/switcher-data-structs.hpp +++ b/switcher-data-structs.hpp @@ -198,6 +198,7 @@ struct IdleData OBSWeakSource scene; OBSWeakSource transition; bool usePreviousScene; + bool alreadySwitched = false; }; typedef enum {