Repository navigation
Ensure Switch controller paradigm exists and recover Mac controllers after sleep - #87
Conversation
controller paradigm exists and recover Mac controllers after sleep
|
reviewing failed checks rn |
swhitt
left a comment
There was a problem hiding this comment.
Main moved to DRIFTED_BASES in check_pinned_bytes.py for evolving capsule bases, so the base_sha256 bumps here fail the pinned-bytes check once merged. Leave the manifest alone and add the touched files to DRIFTED_BASES instead. The manifest also got rewritten CRLF -> LF, which is the whole 12.7k-line diff - definitely fix that.
The body says the lid-sleep part is a non-issue since replugging fixes it. I'd drop that half and keep this to the face etiquette. The tidy-skip lintfix is also duplicated in #88, might be good as its own PR.
| if ((flags & (SDL_WINDOW_MINIMIZED | SDL_WINDOW_HIDDEN)) != 0U) { | ||
| return false; | ||
| } | ||
| return dkr_macos_app_is_active(); |
There was a problem hiding this comment.
[NSApp isActive] is true while a native file picker or other modal panel has key focus, so gameplay input leaks through while typing in it. This also runs from poll_input off the main thread.
| } | ||
| // Close and reopen: after sleep GetAttached can stay true for dead HID | ||
| // handles, so a dirty-only refresh would keep the zombie pads. | ||
| for (ControllerRecord& record : g_controller_devices) { |
There was a problem hiding this comment.
This drops and reopens every pad on each wake, even when they're fine. Do player slot assignments survive that?
| const auto family = dkr::runtime::controllers::detect_controller_family( | ||
| device.name, SdlControllerTypeCode(device.gamepad)); | ||
| if (dkr::runtime::controllers::uses_nintendo_face_etiquette(family)) { | ||
| dkr::runtime::controllers::apply_nintendo_face_etiquette(packet.buttons); |
There was a problem hiding this comment.
Anyone on SDL3 native with a Switch pad who already rebound buttons gets A/B and X/Y silently swapped after this. Is that intentional, or should saved bindings be migrated?
What
Switch Pro / Joy-Con defaults now follow the controller face etiquette: printed A/B/X/Y match the binding tokens. SDL2 pins
SDL_GAMECONTROLLER_USE_BUTTON_LABELS=1; SDL3's position-mode reports are remapped in the SDL3 input host before bindings see them. NSO N64 / GameCube pads stay on their existing label-oriented paths.Also fixes dead input after closing a MacBook lid while paused: on wake we treat a frontmost app as input-capable when SDL's focus bit is stale, and force-reopen controller handles so pads come back in the same session without unplugging.
Pattern checklist
runtime-recomp/,modding/orscripts/(no newpatches/<name>/)*.patchfiles registered inpatches/manifest.json(n/a)guest-hooks/hooks.toml; symbols only viasymbols/*.toml(n/a)docs/CONTROLLERS.mdnote only)netplay/legacy_identity.hppupdated (reviewed by both owners) if simulation, wire or owned-service behaviour changed(n/a)
python scripts/check.py --suite guardpasses locally (DKRControllerFaceEtiquetteadded)/ iOS / Android not rebuilt for this PR.
Risk
Low. Etiquette remap is limited to Switch Pro / Joy-Con families; Xbox/PS and NSO N64/GC are unchanged. Mac wake recovery only force-reopens pads and relaxes the focus gate while
NSAppis active, so backgrounded windows still drop gameplay input. Capsulebase_sha256pins updated for the touched first-party files. Revert the commit to roll back.