From 801fa8e905c9ff73c993c940e3e7966e55efc4cb Mon Sep 17 00:00:00 2001 From: Pokechu22 Date: Mon, 17 Apr 2023 23:18:42 -0700 Subject: [PATCH] Only force-show the code widget when first enabling the debugger Before, any call of Settings::SetDebugModeEnabled(true) would show it. This means that if the debugging UI is enabled, but the user manually closed the code widget, then toggling any option on the interface pane (such as "Pause on Focus Loss") would cause the code widget to reappear. Additionally, closing and reopening dolphin did not call SetDebugModeEnabled, so the code widget did not reappear in that case (it only appeared after touching the interface pane). This is a bit silly, so now only enabling the debugger does it. This also somewhat resolves an inconsistency introduced by the previous commit: prior to it, --debugger would call SetDebugModeEnabled(true) and thus show the code pane; after these commits, it does not, as it acts like a config change. This is a behavior difference, but not a particularly important one. --- Source/Core/DolphinQt/Settings.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/DolphinQt/Settings.cpp b/Source/Core/DolphinQt/Settings.cpp index bfc2f36ea1..d915f4e916 100644 --- a/Source/Core/DolphinQt/Settings.cpp +++ b/Source/Core/DolphinQt/Settings.cpp @@ -465,9 +465,9 @@ void Settings::SetDebugModeEnabled(bool enabled) { Config::SetBaseOrCurrent(Config::MAIN_ENABLE_DEBUGGING, enabled); emit DebugModeToggled(enabled); + if (enabled) + SetCodeVisible(true); } - if (enabled) - SetCodeVisible(true); } bool Settings::IsDebugModeEnabled() const