feat(windows-client): SDL3 gamepads + docs — full stage-1 parity, MSVC-green
apple / swift (push) Successful in 54s
audit / cargo-audit (push) Failing after 1m19s
android / android (push) Failing after 2m22s
ci / web (push) Successful in 41s
ci / docs-site (push) Successful in 33s
ci / bench (push) Successful in 1m56s
deb / build-publish (push) Successful in 3m28s
ci / rust (push) Successful in 7m23s
docker / build-push (--build-arg FEDORA_VERSION=44, ci, ci/fedora-rpm.Dockerfile, punktfunk-fedora44-rpm) (push) Successful in 6s
docker / build-push (., web/Dockerfile, punktfunk-web) (push) Successful in 4s
decky / build-publish (push) Successful in 12s
docker / build-push (ci, ci/fedora-rpm.Dockerfile, punktfunk-fedora-rpm) (push) Successful in 4s
docker / build-push (ci, ci/rust-ci.Dockerfile, punktfunk-rust-ci) (push) Successful in 4s
docker / build-push (docs-site, docs-site/Dockerfile, punktfunk-docs) (push) Successful in 18s
flatpak / build-publish (push) Successful in 3m59s
rpm / build-publish (bazzite, punktfunk-fedora-rpm) (push) Successful in 5m21s
docker / deploy-docs (push) Successful in 7s
rpm / build-publish (fedora-44, punktfunk-fedora44-rpm) (push) Successful in 4m43s

Adds the SDL3 gamepad service (near-verbatim port of the GTK client's — SDL3 is
cross-platform) and wires it into the winit app: per-session capture (buttons/axes,
DualSense touchpad + motion 0xCC), feedback (rumble, lightbar, raw DualSense effects),
single-pad-forwarded model with auto pad-type from the physical controller. Built from
source on Windows (no system SDL3).

- gamepad.rs: GamepadService (app-lifetime SDL thread) attach/detach on session
  connect/end; auto_pref resolves "Automatic" to the attached pad's type.
- app.rs: hold the service, attach on Connected, detach on Ended/Failed/close. Also
  simplify the keydown path (drop the identical if/else arms).
- main.rs: start the service for the windowed path, resolve GamepadPref from settings +
  the physical pad.

Build gotcha documented + fixed in the dev loop: SDL3's build-from-source MSVC
precompiled-header chokes on the `ü` in the dev box's username embedded in the cargo
registry path (MSB8084/C4828) — CARGO_HOME must be an ASCII path
(C:\Users\Public\.cargo). Unrelated to our code.

Docs: CLAUDE.md M4 + docs/windows-client-bootstrap.md status banner (winit-not-Reactor
rationale, CARGO_HOME gotcha, what's pending) + docs-site clients.md "Windows desktop
client (in development)". Crate is build + clippy + fmt + test green on
x86_64-pc-windows-msvc.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-15 22:11:35 +00:00
parent e4bdec97bd
commit 296b976b8f
8 changed files with 711 additions and 18 deletions
+17 -3
View File
@@ -21,6 +21,8 @@ mod audio;
#[cfg(windows)]
mod discovery;
#[cfg(windows)]
mod gamepad;
#[cfg(windows)]
mod keymap;
#[cfg(windows)]
mod present;
@@ -153,20 +155,31 @@ fn main() {
}
}
let headless = flag("--headless");
// The app-lifetime gamepad service runs only for the windowed client; it also resolves the
// "Automatic" pad type to whatever physical controller is attached (other-client parity).
let gamepad_service = (!headless).then(gamepad::GamepadService::start);
let gamepad_pref = match GamepadPref::from_name(&settings.gamepad) {
Some(GamepadPref::Auto) | None => gamepad_service
.as_ref()
.map_or(GamepadPref::Auto, |s| s.auto_pref()),
Some(explicit) => explicit,
};
tracing::info!(%host, port, ?mode, tofu = pin.is_none(), "connecting");
let handle = session::start(session::SessionParams {
host: host.clone(),
port,
mode,
compositor: CompositorPref::Auto,
gamepad: GamepadPref::Auto,
gamepad: gamepad_pref,
bitrate_kbps,
mic_enabled,
pin,
identity,
});
if flag("--headless") {
if headless {
run_headless(handle);
return;
}
@@ -177,7 +190,8 @@ fn main() {
port,
tofu: pin.is_none(),
};
if let Err(e) = app::WinApp::new(handle, info, true).run() {
let gamepad_service = gamepad_service.expect("started for the windowed path");
if let Err(e) = app::WinApp::new(handle, info, gamepad_service).run() {
tracing::error!(error = %e, "windowed app failed");
std::process::exit(1);
}