Preserve the game aspect ratio in bordered windows #3388

Open
github-bot wants to merge 1 commit from github-bot/gh-3388 into main AGit
Owner

@⁠jim139129 on GitHub · 2026-11-29 22:40 UTC · original
jim139129:fix/bordered-window-client-aspect → main · +82 −42 · 1 files · 1 commits · open

What it changes

On a 2560×1440 desktop, a Series S game presenting at 1920×1080 looked too wide in its bordered window. Win32 takes the outer dimensions at creation, so the caption and borders took space away from the game.

Both CreateWindowEx paths now use the monitor DPI, window style and menu to calculate the frame. They fit the picture into the remaining work area or configured window limit before adding the frame back.

How it was tested

  • The reporter confirmed the fix in game on a GeForce RTX 4060 Laptop GPU with the Series S profile, 1080p output, DLSS Performance and 4× frame generation.
  • The regression test measures the client area of a real bordered Win32 window and checks fitting with a window size limit.
  • Release build and staged asset policy passed.
  • cargo test --locked --profile diag -p victory-hle -- --test-threads=1 passed (424 unit tests and 2 integration tests, 5 ignored). The first parallel run had one failure in a_read_by_range_waits_only_for_a_remapping_that_meets_it, which passed on the serial run.

Checked for overlap

  • Checked the fork and upstream. #2689 covers switching into borderless fullscreen. Marvisak/VIctory#1455 added the maximum window size. This change covers the initial client dimensions of a bordered title window.
**@⁠jim139129** on GitHub · 2026-11-29 22:40 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3388) `jim139129:fix/bordered-window-client-aspect` → `main` · +82 −42 · 1 files · 1 commits · open ## What it changes On a 2560×1440 desktop, a Series S game presenting at 1920×1080 looked too wide in its bordered window. Win32 takes the outer dimensions at creation, so the caption and borders took space away from the game. Both CreateWindowEx paths now use the monitor DPI, window style and menu to calculate the frame. They fit the picture into the remaining work area or configured window limit before adding the frame back. ## How it was tested - The reporter confirmed the fix in game on a GeForce RTX 4060 Laptop GPU with the Series S profile, 1080p output, DLSS Performance and 4× frame generation. - The regression test measures the client area of a real bordered Win32 window and checks fitting with a window size limit. - Release build and staged asset policy passed. - `cargo test --locked --profile diag -p victory-hle -- --test-threads=1` passed (424 unit tests and 2 integration tests, 5 ignored). The first parallel run had one failure in `a_read_by_range_waits_only_for_a_remapping_that_meets_it`, which passed on the serial run. ## Checked for overlap - [x] Checked the fork and upstream. #2689 covers switching into borderless fullscreen. Marvisak/VIctory#1455 added the maximum window size. This change covers the initial client dimensions of a bordered title window.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 22:46:07 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/3388/head:github-bot/gh-3388'
git switch 'github-bot/gh-3388'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3388'
git switch 'github-bot/gh-3388'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3388'
git switch 'github-bot/gh-3388'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3388'
git switch 'main'
git merge --squash 'github-bot/gh-3388'
git switch 'main'
git merge --ff-only 'github-bot/gh-3388'
git switch 'main'
git merge 'github-bot/gh-3388'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!3388
No description provided.