Controllers behind other windows: a menu row and HOS_INPUT_BACKGROUND #359
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!359
Loading…
Reference in a new issue
No description provided.
Delete branch "input-background"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The pads only count while the game's window is in front (
game_in_front()inhost/nn_hid.c). That breaks streaming: with Sunshine putting the game on a screen of its own and Moonlight on a TV, the controller stops working as soon as anything on the desktop takes the focus. The same happens with the game left running behind another window.This adds an opt-in:
hookshot_options.inilike the others. The host reads it through the renderer's existingoption()callback as id 4.HOS_INPUT_BACKGROUND=1/=0: overrides the menu, for scripts and launchers.SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS), so nothing changes there.tests/test_input_background.pycompiles the decision on its own and checks the menu row and the option wiring (python -I -B tests/test_input_background.py). It isn't in.github/workflows/source-regressions.ymlyet: this account can't push workflow changes, so it would need a step there next to "Check controller rumble keeps going" (Linux, needs gcc), withhost/nn_hid.cand the test added to the path filters.Tested on Linux (Sway, Sunshine to Moonlight): with the row On and another window focused, a Switch Pro Controller keeps playing; the log still notes
hid: input paused: the game window is not in frontfor the keyboard. With it Off, behaviour is unchanged.