summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.cpp
diff options
context:
space:
mode:
authorLéo Lam <leo@leolam.fr>2022-01-01 17:32:54 +0100
committerGitHub <noreply@github.com>2022-01-01 17:32:54 +0100
commit8b6b96a114286f097e90c4af3ab99fe91972234a (patch)
tree64cadebf483c5eb38de2a3bc18cee2b354ef110b /Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.cpp
parent8dd803bf2b0ef7d750fedb810661b963c9a47130 (diff)
parentde7c78ef3dae0977c182071eebe139e0362ded5d (diff)
Merge pull request #10285 from Pokechu22/cursor-disabled-input-gate
ControllerEmu: Hide the cursor if the input gate is disabled
Diffstat (limited to 'Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.cpp')
-rw-r--r--Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.cpp b/Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.cpp
index 9c280ab135..043ef37356 100644
--- a/Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.cpp
+++ b/Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.cpp
@@ -140,8 +140,11 @@ Cursor::StateData Cursor::GetState(const bool adjusted)
m_prev_result = result;
- // If auto-hide time is up or hide button is held:
- if (!m_auto_hide_timer || controls[4]->GetState<bool>())
+ // If auto-hide time is up, the hide button is held, or the input gate is disabled, hide the
+ // cursor. We need to check the input gate explicitly as the hide button check always returns
+ // false if the input gate is disabled (e.g. the window is not focused with background input
+ // disabled)
+ if (!m_auto_hide_timer || !ControlReference::GetInputGate() || controls[4]->GetState<bool>())
{
result.x = std::numeric_limits<ControlState>::quiet_NaN();
result.y = 0;