From b7d7ad677efadaf6d505266da3ffe93b73c7e758 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Trzci=C5=84ski?= Date: Fri, 20 Jan 2023 15:34:32 +0100 Subject: [PATCH] SteamController: Fix detection of the Steam client released around 2023-01-20, version: 1674182294 --- RELEASE.md | 1 + SteamController/Helpers/SteamConfiguration.cs | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 300f6a3..687a34f 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -9,6 +9,7 @@ ## 0.6.x +- SteamController: Fix detection of the Steam client released around 2023-01-20, version: 1674182294 - All: Improve Anti-Cheat protection to allow to dismiss it - SteamController: Fix `STEAM+DPadUp` not working - PowerControl/SteamController: Improve RTSS detection to ignore processes not generating frames for over 5s diff --git a/SteamController/Helpers/SteamConfiguration.cs b/SteamController/Helpers/SteamConfiguration.cs index 98df7c0..a419fe5 100644 --- a/SteamController/Helpers/SteamConfiguration.cs +++ b/SteamController/Helpers/SteamConfiguration.cs @@ -56,6 +56,9 @@ namespace SteamController.Helpers get { var steamWindow = FindWindow("SDL_app", "SP"); + // Support Steam client released around 2023-01-20, version: 1674182294 + if (steamWindow == IntPtr.Zero) + steamWindow = FindWindow("SDL_app", "Steam Big Picture Mode"); if (steamWindow == IntPtr.Zero) return false; @@ -80,10 +83,17 @@ namespace SteamController.Helpers StringBuilder windowText = new StringBuilder(256); if (GetWindowText(hWnd, windowText, windowText.Capacity) == 0) return false; - if (!windowText.ToString().StartsWith("SP")) - return false; - return ForegroundProcess.Find(hWnd)?.ProcessName == "steamwebhelper"; + bool valid = false; + + // Support old Steam Clients + valid = valid || windowText.ToString().StartsWith("SP"); + + // Support Steam client released around 2023-01-20, version: 1674182294 + // TODO: It appears that controller is not consumed when outside of big picture mode + // valid = valid || windowText.ToString().StartsWith("Controller Layout"); + + return valid && ForegroundProcess.Find(hWnd)?.ProcessName == "steamwebhelper"; } }