feat(apex): auto-recover gamepad on wake (rebased onto main, picks up #161 re-grab fix)#165
Merged
Merged
Conversation
Re-introduces the auto-recover-on-wake toggle + logind PrepareForSleep listener that #164 removed, rebuilt on top of current main so the resume path runs through main's recover() — which already carries the #161 InputPlumber re-grab fix. That closes the wrong/duplicate-target ("pad works in menus, dead in Steam's main UI") regression that got the original #160 reverted: on every auto-rebind, recover() now delegates to the input-plumber plugin's restartInputPlumber, preserving the QAM->F16 wake profile. Hardening over the original re-add: - onResume settle timer is tracked and cancelled on stop/unload, so a teardown mid-resume can't fire a rebind after the listener is gone. - the streaming dbus-monitor's exit nulls the wake handle, so getStatus().listenerRunning reflects reality instead of reporting a dead listener as healthy. - adds wake-path test coverage (enable/disable persist+start/stop, onLoad restore, onUnload teardown, resume->recover, non-Apex guard) and a UI test for the toggle — the original re-add had none. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0d9ae26 to
0e8a3c1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rebased onto main — blockers cleared
This re-introduces the auto-recover-on-wake toggle + logind
PrepareForSleeplistener that #164 removed. It has now been rebased onto currentmainand reconstructed as a single clean commit (no revert/reapply/duplicate-blacklist noise), so it isMERGEABLEagainst main.Why the original was reverted (#160)
The on-wake rebind hotplugs the pad on a fresh USB node, but InputPlumber kept its grab on the old node and read the rebound pad as a duplicate/dead controller — the "pad works in the overlay/menus but is dead in Steam's main UI" state. That, fired automatically on every wake, is why #160 was pulled.
How this version fixes it
Because it now sits on top of
main,onResume()→this.recover()→runRecover(this.deps)runs through main's recover path, which already carries the #161 InputPlumber-delegation fix: after a successful rebind it delegates to the input-plumber plugin'srestartInputPlumber, re-grabbing the pad cleanly and preserving the QAM→F16 wake profile across the restart. Verified live on-device — the journal showsrestarting InputPlumber to re-grab the recovered pad→wake: recovered gamepad.Pre-revival conditions (from the original PR body) — now met
mainso the recovery path picks up the fix(apex): re-grab InputPlumber after a gamepad rebind #161 fix.restartInputPlumber; it can no longer land in the half-working state.Hardening over the original re-add
dbus-monitor's exit nulls the wake handle, sogetStatus().listenerRunningreflects reality instead of reporting a dead listener as healthy.onLoadrestore,onUnloadteardown, resume→recover, non-Apex guard, plus a UI toggle test.Gates green: typecheck · eslint · check-plugin-specs · apex tests (24/24).
🤖 Generated with Claude Code