input, run.sh: fix Proton controller group access, VICTORY_ONE_PAD default, and fullscreen mouse re-lock #176

Manually merged
github merged 3 commits from github-bot/gh-176 into main 2026-12-02 19:16:52 +00:00 AGit
Owner

@⁠liomaroliveira on GitHub · 2026-12-02 10:14 UTC · original
liomaroliveira:fix/proton-controller-and-mouse-capture → main · +27 −3 · 3 files · 3 commits · merged 2026-12-02 19:14 UTC

What

  1. gameinput.rs: Enable VICTORY_ONE_PAD by default (parse_one_pad: None or anything other than "0" -> true) and add a unit test.
  2. run.sh: Skip unshare -rnm --propagation private when PROTON_DIR is set, keeping the systemd-run memory scope and menu restart loop intact.
  3. mouse.rs: On WM_LBUTTONDOWN / WM_RBUTTONDOWN, if CAPTURE.window == hwnd and last_raw.is_none(), call release(hwnd) before acquire(hwnd) to re-lock fullscreen mouse capture.

Why

  1. VICTORY_ONE_PAD default: The docstring on one_pad() already documents it as on by default (VICTORY_ONE_PAD=0 to disable), but the implementation checked == "1". Without VICTORY_ONE_PAD=1 set manually, hotplugging a pad or waking one from sleep leaves the title on its controller-disconnected screen.
  2. run.sh under Proton: Complements #129 (SDL_JOYSTICK_DISABLE_UDEV=1). tools/play-wine.sh only bind-mounts wineserver when PROTON_DIR is unset; under Proton, unshare -rnm is not needed for mounts, and an unprivileged user namespace (-r) drops supplementary groups (input -> nobody), causing EACCES on /dev/input/event* and /dev/input/js* owned by root:input without uaccess ACLs.
  3. Fullscreen mouse re-lock: Under VICTORY_FULLSCREEN=1 (Proton / Wayland / XWayland), initial WM_SETFOCUS / WM_ACTIVATE can set CAPTURE.window before raw input starts (last_raw.is_none()), causing subsequent clicks to hit acquire()'s early return and leaving mouse look stuck until Alt-Tab.

Checked

  • ./build.sh (x86_64-pc-windows-msvc release cross-compile) passed cleanly.
  • cargo test -p xtask switches::documented_switches_are_read passed.
  • Tested on CachyOS (RX 6700 XT, proton-cachyos-slr 11.0-20261015) with VICTORY_FULLSCREEN=1: verified supplementary input group is preserved under Proton, controller hotplug works without controller-disconnected lock, and clicking in fullscreen re-locks mouse look.
**@⁠liomaroliveira** on GitHub · 2026-12-02 10:14 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/176) `liomaroliveira:fix/proton-controller-and-mouse-capture` → `main` · +27 −3 · 3 files · 3 commits · merged 2026-12-02 19:14 UTC ## What 1. **`gameinput.rs`**: Enable `VICTORY_ONE_PAD` by default (`parse_one_pad`: `None` or anything other than `"0"` -> `true`) and add a unit test. 2. **`run.sh`**: Skip `unshare -rnm --propagation private` when `PROTON_DIR` is set, keeping the `systemd-run` memory scope and menu restart loop intact. 3. **`mouse.rs`**: On `WM_LBUTTONDOWN` / `WM_RBUTTONDOWN`, if `CAPTURE.window == hwnd` and `last_raw.is_none()`, call `release(hwnd)` before `acquire(hwnd)` to re-lock fullscreen mouse capture. ## Why 1. **`VICTORY_ONE_PAD` default**: The docstring on `one_pad()` already documents it as on by default (`VICTORY_ONE_PAD=0` to disable), but the implementation checked `== "1"`. Without `VICTORY_ONE_PAD=1` set manually, hotplugging a pad or waking one from sleep leaves the title on its controller-disconnected screen. 2. **`run.sh` under Proton**: Complements #129 (`SDL_JOYSTICK_DISABLE_UDEV=1`). `tools/play-wine.sh` only bind-mounts `wineserver` when `PROTON_DIR` is unset; under Proton, `unshare -rnm` is not needed for mounts, and an unprivileged user namespace (`-r`) drops supplementary groups (`input` -> `nobody`), causing `EACCES` on `/dev/input/event*` and `/dev/input/js*` owned by `root:input` without `uaccess` ACLs. 3. **Fullscreen mouse re-lock**: Under `VICTORY_FULLSCREEN=1` (Proton / Wayland / XWayland), initial `WM_SETFOCUS` / `WM_ACTIVATE` can set `CAPTURE.window` before raw input starts (`last_raw.is_none()`), causing subsequent clicks to hit `acquire()`'s early return and leaving mouse look stuck until Alt-Tab. ## Checked - `./build.sh` (`x86_64-pc-windows-msvc` release cross-compile) passed cleanly. - `cargo test -p xtask` `switches::documented_switches_are_read` passed. - Tested on CachyOS (RX 6700 XT, `proton-cachyos-slr` 11.0-20261015) with `VICTORY_FULLSCREEN=1`: verified supplementary `input` group is preserved under Proton, controller hotplug works without controller-disconnected lock, and clicking in fullscreen re-locks mouse look.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-02 10:18:59 +00:00
github manually merged commit 2d01654a4b into main 2026-12-02 19:16:52 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.