Windows input optimizations

Fixes a bug where the thread wouldn't sleep when it should in some
configurations.

Also increases the time between polls for new controllers.
This commit is contained in:
Henrik Rydgård committed 2026-03-09 11:02:04 +01:00
1 parent 593e0fd8d9
commit 82069c3503
5 files changed
+7 -8

No files matched your search

+2 -2
View File
@@ -42,12 +42,12 @@ void InputManager::InputThread() {
// NOTE: The keyboard and mouse buttons are handled via raw input, not here.
// This is mainly for controllers which need to be polled, instead of generating events.
bool noSleep = false;
while (runThread_.load(std::memory_order_relaxed)) {
bool noSleep = false;
if (focused_.load(std::memory_order_relaxed) || !g_Config.bGamepadOnlyFocused) {
System_Notify(SystemNotification::POLL_CONTROLLERS);
for (const auto &device : devices_) {
int state = device->UpdateState();
const int state = device->UpdateState();
if (state == InputDevice::UPDATESTATE_SKIP_PAD)
break;
if (state == InputDevice::UPDATESTATE_NO_SLEEP) {