Game: Mod API Windows sandbox blocks controller input #2010
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot#2010
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Reporter-confirmed broker fix: PR #2016
The reporter has now confirmed that controller input works with the game sandbox enabled using the native SDL controller broker implementation. Both the PS4 and Nintendo Switch Pro remain connected. The WGI-only approach below was insufficient and has been replaced.
Fix: #2016, targeting
mod-apias a focused contribution to #1958. Gameplay was confirmed at local implementation9ac1daf6; its six changed controller/broker source files are identical to PR headdd7027bf. Fifteen targeted checks pass. The PR remains WIP for complete suite/baseline validation, Linux builds and performance measurements; physical gyro, rumble and reconnect testing are also listed as pending.Earlier WGI-only follow-up: unresolved
The user tested the patched game (
8b6b7c9d) and reports that controller input still does not work. The new log confirms that the patched executable is running inside AppContainer and both controllers open through SDL. Enabling WGI restores discovery/opening only; it is not a verified fix for usable controller input. At that point, the sandbox-off diagnostic was the only configuration the user had confirmed working. The patch branch is a partial candidate and should not be treated as resolving this issue.Problem
On the Windows Mod API preview in #1958, enabling the AppContainer sandbox prevents SDL from detecting either of two connected controllers. The same game, controllers and SDL DLL work with
HOS_SANDBOX=0.This is a report against the unmerged
mod-apibranch, not a claim that currentmainhas this sandbox regression. Disabling the sandbox was a diagnostic, not the proposed fix.Environment and reproduction
v3.0.0-660-g66cf1bee, based on API commit3e92b24957ad923e45dd3ba9f232987bb887bd52, plus a local Windowsnearmacro compile fix invk_texture.cpp.HOS_SANDBOX=1to force it), then try the controller. Keyboard input works; controller input does not.HOS_SANDBOX=0: both controllers connect, and the user confirmed the controller works in the game. Neither controller was unplugged.Evidence and cause
Sandbox on: the log confirms an AppContainer with no capabilities, SDL controller support initializes, but there are no controller-connected lines and prompts select
controller "(none)": keyboard.Sandbox off:
A game-free native probe using that same SDL DLL and the existing Longshot.Game AppContainer isolated the backend difference:
SDL_JOYSTICK_WGI=1SDL_JOYSTICK_GAMEINPUT=1aloneSDL3's Windows.Gaming.Input backend is off by default (SDL documentation). Longshot's sandbox documentation identifies WGI as the route around direct HID access, but
pads_start()does not enable it.Partial candidate for #1958: detection only
Patch branch: fix/windows-sandbox-controllers, based on API head
443f7d3d, with two cherry-pickable commits:The change calls
hos_sdl_hint("SDL_JOYSTICK_WGI", "1")before controller subsystem initialization, only on Windows whenhos_sandbox_confined()is true. It uses normal SDL hint priority, so an explicit environment override still wins. It adds no capabilities and does not disable the sandbox or the other controller backends.The same patch was built and run locally on the original API test base as
8b6b7c9d. The later API head was not rebuilt; the branch above carries just the test and fix onto that head for the API author to take. This avoids opening a second main-targeted PR containing the whole unmerged API.In the patched game, a bounded headless run with
HOS_SANDBOX=1and no WGI environment setting logs:The Switch Pro appears under the generic WGI name. Repeating with
SDL_JOYSTICK_WGI=0keeps confinement but restores zero controllers, confirming the override and the backend cause. Each check used fresh isolated saves, skipped pipeline precompilation, rendered frames, and terminated only its own test process.Validation and remaining coverage
pads_start()with stand-ins. It fails before the fix (wgi == confined) and passes after. It checks initialization order, confined/unconfined Windows, the non-Windows preprocessor path, and SDL initialization failure.test_pad_appcontainer,test_headless_sigterm,test_sdl_pad_diagnostics,test_steam_pads,test_gyro_rearm,test_rumble_refresh,test_stick_rest.443f7d3d.The two original game logs and the controller probes are retained locally; excerpts above omit machine-specific paths. No game files or saves are attached.
Possibly related, for context:
Game: Mod API Windows sandbox hides HID controllers; enabling SDL WGI restores detectionto Game: Mod API Windows sandbox blocks controller input; WGI restores detection onlyHands-on follow-up: the user reports that the WGI patch still does not make the controller usable. The latest log confirms
v3.0.0-662-g8b6b7c9d, AppContainer confinement, and both SDL controller connections. Discovery/opening passed; gameplay input did not. I have corrected the issue title and description to mark the patch as partial. The sandbox-off run remains the confirmed working comparison. This issue tracks a bug in PR #1958; no duplicate API PR was opened.Game: Mod API Windows sandbox blocks controller input; WGI restores detection onlyto Game: Mod API Windows sandbox blocks controller inputReporter confirms actual controller input works with the sandbox enabled. The broker fix is now proposed in #2016 against
mod-api. This replaces the WGI-only candidate; the issue remains open pending review/merge.