From c13791123430d6430404fc4d0ffaf6323dfd9fe5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 21 Nov 2025 02:53:45 +0000 Subject: [PATCH] Remove unnecessary RetryException from CheckAndActivateGameWindow Co-authored-by: huiyadanli <15783049+huiyadanli@users.noreply.github.com> --- .../GameTask/Common/PausableDelayManager.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/BetterGenshinImpact/GameTask/Common/PausableDelayManager.cs b/BetterGenshinImpact/GameTask/Common/PausableDelayManager.cs index 731166a9..96156812 100644 --- a/BetterGenshinImpact/GameTask/Common/PausableDelayManager.cs +++ b/BetterGenshinImpact/GameTask/Common/PausableDelayManager.cs @@ -156,16 +156,15 @@ public class PausableDelayManager private void CheckAndActivateGameWindow() { + // If RestoreFocusOnLostEnabled is disabled, we require the game window to be active + // Keep retrying until it is active if (!TaskContext.Instance().Config.OtherConfig.RestoreFocusOnLostEnabled) { - if (!SystemControl.IsGenshinImpactActiveByProcess()) - { - Logger.LogInformation("当前获取焦点的窗口不是原神,暂停"); - throw new RetryException("当前获取焦点的窗口不是原神"); - } + // Just proceed to the retry loop below which will ensure window is active } var count = 0; + // Keep retrying until window is active while (!SystemControl.IsGenshinImpactActiveByProcess()) { if (count >= 10 && count % 10 == 0)