From 0c15c9eaa8adb655b4f42c1830d6ed3c901fe39a Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sun, 4 Aug 2024 20:58:10 +1000 Subject: [PATCH] Qt: Fix bug where config-based RAIntegration occasionally failed --- src/core/system.cpp | 4 ---- src/duckstation-qt/qthost.cpp | 8 +++++++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/core/system.cpp b/src/core/system.cpp index abd33893e..43b1ff1db 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -442,10 +442,6 @@ bool System::Internal::CPUThreadInitialize(Error* error) // This will call back to Host::LoadSettings() -> ReloadSources(). LoadSettings(false); -#ifdef ENABLE_RAINTEGRATION - if (Host::GetBaseBoolSettingValue("Cheevos", "UseRAIntegration", false)) - Achievements::SwitchToRAIntegration(); -#endif if (g_settings.achievements_enabled) Achievements::Initialize(); diff --git a/src/duckstation-qt/qthost.cpp b/src/duckstation-qt/qthost.cpp index 508152acf..49ff8d131 100644 --- a/src/duckstation-qt/qthost.cpp +++ b/src/duckstation-qt/qthost.cpp @@ -45,8 +45,8 @@ #include "scmversion/scmversion.h" -#include "imgui.h" #include "core/bus.h" +#include "imgui.h" #include #include @@ -167,6 +167,12 @@ bool QtHost::PerformEarlyHardwareChecks() bool QtHost::EarlyProcessStartup() { + // Config-based RAIntegration switch must happen before the main window is displayed. +#ifdef ENABLE_RAINTEGRATION + if (!Achievements::IsUsingRAIntegration() && Host::GetBaseBoolSettingValue("Cheevos", "UseRAIntegration", false)) + Achievements::SwitchToRAIntegration(); +#endif + Error error; if (System::Internal::ProcessStartup(&error)) [[likely]] return true;