Merge pull request #10285 from Pokechu22/cursor-disabled-input-gate

ControllerEmu: Hide the cursor if the input gate is disabled
This commit is contained in:
Léo Lam 2022-01-01 17:32:54 +01:00 committed by GitHub
commit 8b6b96a114
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -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;