feat(hle): per-monitor v2 DPI awareness and aspect-preserving ultrawide fullscreen #132
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/132"
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 dcastell1 on 2026-11-27T18:39:47Z.
Problem
3413x1440on a5120x2160display at 150% scaling), causingfit()to shrink the client window and DWM to bilinear-upscale every frame.VICTORY_FULLSCREEN=1.fullscreen()previously placed the window at(0, 0, SM_CXSCREEN, SM_CYSCREEN), stretching a 16:9 swap chain horizontally across 21:9 (5120x2160,3440x1440) and 32:9 (5120x1440) monitors.Changes (
crates/victory-hle/src/modules/lifecycle.rs)ensure_dpi_aware(): requestsDPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2viauser32!SetProcessDpiAwarenessContextonce before querying screen/work-area metrics (VICTORY_DPI_AWARE=0restores legacy OS scaling).fullscreen_box(): centres the largest proportional rectangle inside(screen_w, screen_h)using the title's requested dimensions beforefit()adjusts overlapped borders (for example(640, 0, 3840, 2160)1:1 pixel mapping for--res 4kon a5120x216021:9 monitor).VICTORY_FULLSCREEN=stretchpreserves full-screen stretching when explicitly requested.VICTORY_FULLSCREEN_BARS=0disables): when the centred window does not cover the whole screen, spawns a lightweightWS_POPUP | WS_DISABLED(WS_EX_TOOLWINDOW | WS_EX_NOACTIVATE) black backdrop window ordered directly behindhwndand destroyed onWM_NCDESTROY. Because it is disabled and non-activating, clicking the black bars never steals foreground focus from the title window (keeping DLSS Frame Generation active) and never appears in Alt-Tab or the taskbar.(0, 0)that already fit inside the work area (such as2560x1440on a DPI-aware5120x2160desktop) are centred in the work area instead of pinned to(0, 0).Verification
5120x2160(21:9) display at 150% OS scaling.--res 4k --dlss quality --framegen 4 --set VICTORY_FULLSCREEN=1):per-monitor v2 DPI awareness requested ok=true,screen=(5120, 2160), crisp 1:13840x2160presentation with clean black pillarboxes and uninterrupted DLSS Frame Generation focus.cargo test --locked -p victory-hle --lib modules::lifecycle: 12 passed, 0 failed (includingfullscreen_box_preserves_aspect_on_ultrawide_and_tall_screens).cargo clippy --locked --no-deps -p victory-hle --all-targets: 0 warnings inlifecycle.rs.cargo test --locked -p xtask: 6 passed, 0 failed (asset policy green).Note: Made with AI assistance and reviewed, built, and tested by a human.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by cloph-dsp on 2026-11-28T02:52:48Z.
Independent local verification (Windows, Rust 1.100.0/MSVC, no game data):
e080431aa37196687ea2f5db3b0596ecb7cc7852, base (single-commit parent)ca9c75cd6d59b04a096746b313baed986608e63a.cargo test --locked -p victory-hle --lib -- modules::lifecycle::tests::fullscreen_box_preserves_aspect_on_ultrawide_and_tall_screens --exact --test-threads=1 --quiet→ 1 passed, 0 failed, 173 filtered, exit 0.git grep -Ffor the test name on the base returned no hits (test is new on this PR);git diff --check ca9c75cd HEADclean (1 file, +199/-12).CARGO_TARGET_DIR(never shared) withCARGO_BUILD_JOBS=2.AI-assisted (Hy4 flash).