mnk: recover from a poisoned mouse lock, and retry bindings that failed to load #1876
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1876"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by P1ayer-1 on 2026-11-29T01:16:14Z.
Relevant to #1283 (the reload half of it) and to #1180. No issue tracked this exact path, so nothing is closed by this.
What it changes
Two ways mouse and keyboard (
VICTORY_MNK=1) could stay dead for the rest of a run.A poisoned mouse lock.
mouse()took the sharedMousestate withlock().unwrap(). One panic undersample()poisons that mutex, and every later poll then panics on the input thread, so the stand-in pad stops updating until the game is restarted. The rest of the crate recovers from poisoning —config()in this same file, andgameinput.rs'slock()— so this one now recovers the same way.A bindings file that failed once never reloaded.
config()only reloaded from the armSome(Some(_)) if c.0 != changed. A first load that failed is stored asSome(None), which nothing but the_arm matches, so a laterMNK_BINDINGS_CHANGEDcould never reload: F1's KEY BINDINGS would write a valid file andenabled()would stay false, with the menu still saying "Enable MnK to change keybinds", for the rest of the process. The arm now matchesSome(_), so a file that failed once is read again when the menu saves it.Nothing changes when the bindings load normally on the first try. Editing
bindings.iniby hand still needs a restart: only F1's editor movesMNK_BINDINGS_CHANGED.On #1283: if the first load of
bindings.inisucceeded, this changes nothing for that report — their F1 edits would already reload. It is the case where the first load failed (an invalid line, a hand-edited file) that this fixes, which matches "the changes get saved tobindings.ini, but the game still uses the old bindings".How it was tested
d4b5d51plus this patchcargo build --release -p victory→ exit 0;cargo test -p victory-hle --lib gameinput→28 passed; 0 failed; 1 ignoredcargo testpassed for the crates it touches: yes,victory-hleOne caveat, so nothing here is oversold: I could not confirm either path by playing. On this machine a build of
d4b5d51started withVICTORY_MNK=1stops with0xC0000005before the first frame — and so does the same binary with MnK off, and neither is this patch's doing (see #1900, where the same source-build crash is reported at a later offset). The releasedv2026.11.28.03runs on this machine for hours, which is how the two paths below were reached. Both changes are covered by reading and by the tests, not by a run.Checked for overlap
mnk.rsor the input path; none of them changesconfig()ormouse(). #1393 fixes a different cause of the same symptom (the script launcher passingVICTORY_MNK=1withoutVICTORY_MNK_BINDINGS).Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-11-29T08:28:34Z.
Thank you! An earlier version of this pull request was merged into main with its original commits and is part of v2026.11.29.01, where you are credited. GitHub does not show it as merged because new commits were pushed here after that merge. It stays open so those newer commits can be looked at next.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by P1ayer-1 on 2026-11-29T17:35:44Z.
Merged upstream already:
e52b8fbebrought this in through wave-6, and the bindings half was then rewritten as234456f2(arefresh()helper with a test, keeping the last bindings when a later read fails) — a better shape than mine.mouse()on main islock().unwrap_or_else(|e| e.into_inner()), andconfig()recovers the same way, so both paths are closed. Closing as merged; nothing here is left to apply.Pull request closed