Skip to content
Permalink
Browse files
Merge pull request #11038 from AdmiralCurtiss/steam-overlay-crash-fix…
…-wgi

WGInput: Work around crash with Steam overlay.
  • Loading branch information
AdmiralCurtiss committed Sep 8, 2022
2 parents 2dfe913 + 67c97a0 commit 7102103
Showing 1 changed file with 5 additions and 1 deletion.
@@ -544,8 +544,12 @@ class Device : public Core::Device
{
try
{
// Workaround for Steam. If Steam's GameOverlayRenderer64.dll is loaded, battery_info is null.
auto battery_info = m_raw_controller.try_as<WGI::IGameControllerBatteryInfo>();
if (!battery_info)
return false;
const winrt::Windows::Devices::Power::BatteryReport report =
m_raw_controller.TryGetBatteryReport();
battery_info.TryGetBatteryReport();
if (!report)
return false;

0 comments on commit 7102103

Please sign in to comment.