Skip to content

Commit

Permalink
SteamController: Fix detection of the Steam client released around 20…
Browse files Browse the repository at this point in the history
…23-01-20, version: 1674182294
  • Loading branch information
ayufan committed Jan 20, 2023
1 parent 2b9017b commit b7d7ad6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 13 additions & 3 deletions SteamController/Helpers/SteamConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ public static bool IsGamePadUI
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;

Expand All @@ -80,10 +83,17 @@ public static bool IsPossibleGamePadUI
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";
}
}

Expand Down

0 comments on commit b7d7ad6

Please sign in to comment.