Take Alt+Enter from DXGI on every swap chain; Alt+Enter toggles borderless full screen instead #1617
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1617"
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 Jesper-Andersson on 2026-11-28T22:24:59Z.
Fixes: no open issue (this draft PR is the claim).
What it changes
DXGI_MWA_NO_ALT_ENTERwas set only on the Streamline-proxied swap chain. The FSR 3 frame interpolation swap chain (FidelityFX) and the plain swap chain kept DXGI's own Alt+Enter, which switches the chain to exclusive full screen. With FSR 3 frame generation, that hangs the game until Alt+Enter is pressed again.crates/victory-gpu/src/host.rs: one helper,no_alt_enter, runs after every way the swap chain is made (FSR 3, Streamline proxy, plain, Streamline present hook). It gets the swap chain's parent factory (GetParent) and callsMakeWindowAssociation(hwnd, DXGI_MWA_NO_ALT_ENTER)on it, which is the factory Microsoft's docs require. A failure is logged.crates/victory-hle/src/modules/lifecycle.rs: the window procedure handles Alt+Enter itself (WM_SYSKEYDOWN/UP/SYSCHARwithVK_RETURNand the Alt bit) and does not pass it on. On a key-down without repeat, on a top-level window, it toggles a borderlessWS_POPUPwindow over the window's monitor (MonitorFromWindow/GetMonitorInfoW). Toggling back restores the earlier style and rectangle. The startupVICTORY_FULLSCREENpath (upstream's aspect-fitted box with the black backdrop) goes through the same helper, so Alt+Enter also leaves that mode, and going back to windowed removes the backdrop window.ResizeBuffersand no FSR 3 context recreation.docs/dlss.mdsay that Alt+Enter toggles borderless full screen and that exclusive full screen isn't used.This is a behaviour change with no switch: Alt+Enter never goes to exclusive full screen any more, on any swap chain, and it now toggles borderless full screen. With DLSS frame generation (the Streamline path) Alt+Enter already did nothing at the DXGI level; now it toggles borderless there too.
Background (from the existing code comment and general knowledge of the DXGI docs, not re-read for this PR):
MakeWindowAssociationhas to be called on the factory that made the swap chain; borderless windowed is the usual choice with flip-model swap chains; the Streamline guide (section 12.0, as cited in the existing comment) wants frame generation off across a windowed/full-screen change.How it was tested
borderless_style) and the key test (is_alt_enter: Alt+Enter told apart from plain Enter,WM_KEYDOWNand Alt+F4). A release build passes. Not yet tried in game. Not tested at all: DLSS frame generation, no frame generation, VRR/tearing, multiple monitors, HDR. This PR stays a draft until Alt+Enter has been tried in game with FSR 3 frame generation, with DLSS frame generation and without frame generation.cargo testpassed for the crates it touches: yes (victory-gpu: 550 passed; victory-hle: 201 passed)cargo clippy --no-deps -p victory-gpu -p victory-hle: no new warnings;-p victory-hle --all-targets -- -D warningsis clean. victory-gpu: With-D warnings, clippy stops only on lints that are already on main (victory-gpuhost.rs,host/send.rs,pool.rs,resource.rs,streamline.rs,streamline/fsr.rs; victory-shaderemit/lower.rs). The warning set is the same as on main (the open #1527 fixes them).cargo xtask policy: fails on upstream main's owncrates/victory-shader/src/emit/lower.rs(667,523 bytes, over the 640 KiB limit; #1429; the open #1493 and #1527 fix it). Nothing this PR adds trips it, and the pre-commit asset check passed for every file it changes.Checked for overlap
fsr.rs). This PR covers every chain in one place and replaces the key with a borderless toggle. Taking one of the two is enough; if #1132 is merged first, this PR's helper is harmless on top of it.lifecycle.rsand the F1 menu. Same idea on another key. The two could shareenter_borderless/toggle_fullscreen.window_procinlifecycle.rs. Neighbouring lines. The toggle moves and resizes the window, so the capture logic seesWM_SIZE/WM_MOVEas for any resize.lifecycle.rsin other functions. Textual overlap only.This was written with AI assistance (Claude Code).