Fix #27070: Gate polled input on window focus (#27078)

This commit is contained in:
Sjoerd de Bruin authored and GitHub committed 2026-09-13 13:21:11 +00:00
1 parent eb7b5feab9
commit 75c12dbe7d
2 files changed
+9 -3

No files matched your search

+1
View File
@@ -12,6 +12,7 @@
- Fix: [#26754] Switching window tabs by touch could crash the game on some Linux builds.
- Fix: [#27052] Unnamed rides in RCT2 base and Wacky Worlds scenarios have hardcoded English names.
- Fix: [#27056] [Plugin] Loading water palettes from plugin does not update the palette correctly.
- Fix: [#27070] The game keeps responding to input while the window is not focused (primarily gamepads).
- Fix: [#27084] [Plugin] `PermissionType` for `drag_path_area` is missing.
- Fix: [#27087] The ‘Update available’ widget is offset incorrectly.
- Fix: [#27093] Pause and fast forward buttons are shown in multiplayer.
+8 -3
View File
@@ -141,6 +141,9 @@ void InputManager::processAnalogueInput()
_analogueScroll.x = 0;
_analogueScroll.y = 0;
if (!ContextHasFocus())
return;
const int32_t deadzone = Config::Get().general.gamepadDeadzone;
const float sensitivity = Config::Get().general.gamepadSensitivity;
@@ -448,6 +451,11 @@ void InputManager::processChat(const InputEvent& e)
void InputManager::processHoldEvents()
{
_viewScroll = { 0, 0 };
if (!ContextHasFocus())
return;
// Get mouse state
_mouseState = SDL_GetMouseState(nullptr, nullptr);
@@ -458,9 +466,6 @@ void InputManager::processHoldEvents()
std::memcpy(_keyboardState.data(), keys, numkeys);
// Check view scroll shortcuts
_viewScroll.x = 0;
_viewScroll.y = 0;
if (!hasTextInputFocus())
{
auto& shortcutManager = GetShortcutManager();