Window: keep Alt and F10 from freezing the title in menu mode #419
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/419"
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 Marvisak/VIctory. Originally posted by itsRevela on 2026-11-24T03:10:47Z.
What
The title window procedure (
lifecycle.rs,window_proc) now dropsWM_SYSCOMMAND/SC_KEYMENU, next to theSC_CLOSEhandling it already has. Everything else still goes to the title's procedure.Why
Pressing and releasing Alt (or F10) on a window makes
DefWindowProcsendSC_KEYMENU. The default handling for that puts the window into menu mode, which runs a modal menu loop on the thread that owns the window, and that thread is the title's. The title window has no menu bar, so nothing appears on screen. The title just stops: no frames, no input. Grand Theft Auto VI then aborts itself about half a minute later, with the deliberate write to0x0already discussed in #68, at+0x23cf683/+0x2215c35. Its crash reporter then tries to upload a minidump, which VIctory's network filter blocks.So a single Alt tap, for example a half-pressed Alt+Tab, ends the game. A console title never sees a window menu, so dropping it loses nothing. Alt+F4 still closes the window: it arrives as
SC_CLOSE, notSC_KEYMENU. The mouse can still open the window menu from the title bar; this PR doesn't change that path.This removes one trigger of that abort that has nothing to do with the GPU. It doesn't touch the GPU stalls that lead to the same abort in #71 and #59.
Tested
Windows 11 Pro 10.0.26200, NVIDIA GeForce RTX 3070 Ti (driver 32.0.16.1088), Ryzen 9 5900X, Rust 1.98.1 from
rust-toolchain.toml, ond2a4bae.modules::lifecycle::tests::the_keyboard_menu_never_reaches_the_title:SC_KEYMENU(Alt alone, Alt+Space, and with low bits set) andSC_MINIMIZE;SC_MINIMIZEreaches the title;left: [61696, 61696, 61696, 61472]; with the fix it passes.cargo test -p victory-hle: 88 passed, 0 failed.cargo clippy -p victory-hle --tests: nothing inlifecycle.rs. The one warning, inxmem.rs, is already onmain.rustfmt --checkpasses, andcargo xtask policyreports 151 files ok.--features diagnosticsran in Windows Sandbox with vGPU. Each run had the start screen up at 30 fps, put the title window in front, sent one Alt tap and nothing else, and then watched for 75 s:d2a4bae0xc0000005, write0x0), and its crash reporter tries to uploadAI-assisted (Claude Code). The title runs used my own copy; no game data is in this PR.
🤖 Generated with Claude Code
Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T05:41:21Z.
Review: APPROVED
Tested
ff8694aon Windows 11, RTX 5070, MSVC:cargo test --workspace --no-fail-fastpasses (265 passed, 0 failed), including the newthe_keyboard_menu_never_reaches_the_title. Not tested in game.wparam & 0xFFF0 == SC_KEYMENUis the documented way to test system commands, since the low four bits are the system's. The test covers that withSC_KEYMENU | 1.SC_KEYMENUis dropped. The title still getsWM_SYSKEYDOWN/WM_SYSKEYUPfor Alt, Alt+F4 still arrives asSC_CLOSE, and the mouse path to the system menu is unchanged. Alt+Space (the keyboard system menu) is dropped too, which is fine for a window without one.No issues found.
AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-24T04:39:03Z.
Thanks @itsRevela for filtering the keyboard-menu command before it reaches the title procedure. I tested head
ff8694a69a3444bbbbdc37668181708a87d5b5ccwith:Result: 1 passed, 0 failed (86 filtered out). The test sends
SC_KEYMENUvariants andSC_MINIMIZEto a recording title procedure, verifies the menu commands are dropped, and confirms minimize still reaches it. This validates the window-procedure routing in a unit test; I did not run a title.