summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface/WGInput/WGInput.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/WGInput/WGInput.cpp')
-rw-r--r--Source/Core/InputCommon/ControllerInterface/WGInput/WGInput.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/WGInput/WGInput.cpp b/Source/Core/InputCommon/ControllerInterface/WGInput/WGInput.cpp
index 414d246069..fc6441bb8d 100644
--- a/Source/Core/InputCommon/ControllerInterface/WGInput/WGInput.cpp
+++ b/Source/Core/InputCommon/ControllerInterface/WGInput/WGInput.cpp
@@ -544,8 +544,12 @@ private:
{
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;