Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InputCommon: Make the "input gate" not racy. #8456

Merged
merged 1 commit into from Nov 11, 2019

Conversation

@jordan-woyak
Copy link
Member

jordan-woyak commented Nov 6, 2019

The "input gate" suppresses input to the game and the hotkey manager when the window is not focused (depending on settings).

In order to receive input in the controller config window a value was quickly set and cleared to override the input gate.
This periodically leaked input into the game. (noticeable when holding buttons in the config window)

Rather than testing the window focus, background input setting, and override value for each input, a thread_local bool is now maintained with the actual gate value.

This kills Host_UINeedsControllerState.

On the CPU thread the input gate is updated once per SI poll which is well enough granularity.
On the "Host" thread the input gate is updated before checking the hotkeys and then "opened" for everything else in the UI.

@jordan-woyak jordan-woyak changed the title InputCommon: Make the "input gate" not racey. InputCommon: Make the "input gate" not racy. Nov 6, 2019
Copy link
Member

leoetlino left a comment

This sounds better than the old design, but I'd like a second review from someone who is more familiar with the input system

Copy link
Contributor

stenzek left a comment

Seems okay as far as I understand it.

@stenzek stenzek merged commit 913cb08 into dolphin-emu:master Nov 11, 2019
10 checks passed
10 checks passed
default Very basic checks passed, handed off to Buildbot.
Details
lint Build succeeded on builder lint
Details
pr-android Build succeeded on builder pr-android
Details
pr-deb-dbg-x64 Build succeeded on builder pr-deb-dbg-x64
Details
pr-deb-x64 Build succeeded on builder pr-deb-x64
Details
pr-freebsd-x64 Build succeeded on builder pr-freebsd-x64
Details
pr-osx-x64 Build succeeded on builder pr-osx-x64
Details
pr-ubu-x64 Build succeeded on builder pr-ubu-x64
Details
pr-win-dbg-x64 Build succeeded on builder pr-win-dbg-x64
Details
pr-win-x64 Build succeeded on builder pr-win-x64
Details
@jordan-woyak jordan-woyak deleted the jordan-woyak:input-gate-race-fix branch Nov 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.