From f3e5fb59f3e1e7076483d064ed5db5a405feffdd Mon Sep 17 00:00:00 2001 From: WarmUpTill Date: Sat, 3 Dec 2022 06:29:40 +0100 Subject: [PATCH] Reset duration modifier timers when stopping the plugin --- src/advanced-scene-switcher.cpp | 5 +++-- src/macro-core/macro.hpp | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/advanced-scene-switcher.cpp b/src/advanced-scene-switcher.cpp index 27a06836..5c64444e 100644 --- a/src/advanced-scene-switcher.cpp +++ b/src/advanced-scene-switcher.cpp @@ -423,10 +423,11 @@ void SwitcherData::Start() } } -void ResetMacroCounters() +void ResetMacros() { for (auto &m : switcher->macros) { m->ResetCount(); + m->ResetTimers(); } } @@ -443,7 +444,7 @@ void SwitcherData::Stop() th = nullptr; writeToStatusFile("Advanced Scene Switcher stopped"); - ResetMacroCounters(); + ResetMacros(); } server.stop(); diff --git a/src/macro-core/macro.hpp b/src/macro-core/macro.hpp index 95c27315..8b74e380 100644 --- a/src/macro-core/macro.hpp +++ b/src/macro-core/macro.hpp @@ -62,11 +62,12 @@ public: void EnablePauseHotkeys(bool); bool PauseHotkeysEnabled(); + void ResetTimers(); + private: void SetupHotkeys(); void ClearHotkeys(); void SetHotkeysDesc(); - void ResetTimers(); void RunActions(bool &ret, bool ignorePause); void RunActions(bool ignorePause); void SetOnChangeHighlight();