feat(hle): per-monitor v2 DPI awareness and aspect-preserving ultrawide fullscreen #132
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!132
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@dcastell1 on GitHub · 2026-11-27 18:39 UTC · original
dcastell1:feat/dpi-ultrawide-fullscreen→main· +199 −12 · 1 files · 1 commits · openProblem
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.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.