Skip to content

feat(apex): auto-recover gamepad on wake (rebased onto main, picks up #161 re-grab fix)#165

Merged
srsholmes merged 1 commit into
mainfrom
draft/apex-auto-recover-on-wake
Jun 26, 2026
Merged

feat(apex): auto-recover gamepad on wake (rebased onto main, picks up #161 re-grab fix)#165
srsholmes merged 1 commit into
mainfrom
draft/apex-auto-recover-on-wake

Conversation

@srsholmes

@srsholmes srsholmes commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Rebased onto main — blockers cleared

This re-introduces the auto-recover-on-wake toggle + logind PrepareForSleep listener that #164 removed. It has now been rebased onto current main and reconstructed as a single clean commit (no revert/reapply/duplicate-blacklist noise), so it is MERGEABLE against 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's restartInputPlumber, re-grabbing the pad cleanly and preserving the QAM→F16 wake profile across the restart. Verified live on-device — the journal shows restarting InputPlumber to re-grab the recovered padwake: recovered gamepad.

Pre-revival conditions (from the original PR body) — now met

Hardening over the original re-add

  • The post-resume 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 the wake-path test coverage the original lacked: enable/disable persist+start/stop, onLoad restore, onUnload teardown, 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

Base automatically changed from feat/apex-blacklist-hid-oxp to main June 24, 2026 15:36
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>
@srsholmes srsholmes force-pushed the draft/apex-auto-recover-on-wake branch from 0d9ae26 to 0e8a3c1 Compare June 26, 2026 22:32
@srsholmes srsholmes marked this pull request as ready for review June 26, 2026 22:51
@srsholmes srsholmes changed the title DRAFT: feat(apex) auto-recover gamepad on wake (standby — revive if blacklist insufficient) feat(apex): auto-recover gamepad on wake (rebased onto main, picks up #161 re-grab fix) Jun 26, 2026
@srsholmes srsholmes merged commit c939e2e into main Jun 26, 2026
2 checks passed
@srsholmes srsholmes deleted the draft/apex-auto-recover-on-wake branch June 26, 2026 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant