Pr/434 window caption #548

Open
github-bot wants to merge 4 commits from github-bot/gh-548 into main AGit
Owner

@⁠pug205gti6 on GitHub · 2026-11-25 02:06 UTC · original
pug205gti6:pr/434-window-caption → main · +1108 −85 · 15 files · 4 commits · open

No description provided.

**@⁠pug205gti6** on GitHub · 2026-11-25 02:06 UTC · [original](https://github.com/fxceless/victory-fork/pull/548) `pug205gti6:pr/434-window-caption` → `main` · +1108 −85 · 15 files · 4 commits · open *No description provided.*
A console title sizes its window to its render target, which on a 4K screen fills the whole screen. [window] size in victory.toml, or VICTORY_WINDOW_SIZE, now chooses the window instead: "title" (the default, as before: the title's size shrunk to the work area), "<width>x<height>" (a client area of that size, centred, shrunk to the work area if it does not fit), or "fullscreen" (borderless over the primary screen). Only the window changes; the title renders at its own size and the swap chain stretches the frame to the window.

victory now makes itself per-monitor DPI aware before any window exists, so sizes are physical pixels: on a screen scaled to 150 %, 1920x1080 is a quarter of a 4K screen, not 2880x1620. The client size is estimated with AdjustWindowRectExForDpi and corrected after creation if the real frame differs. The placement is a pure function, tested per mode without a screen.

(cherry picked from commit 3ec3bc906c17d45438a8ec411551a150a86b0a16)

AI-assisted (Claude Code)
The title keeps its own windows hidden, so the window on screen is the one victory-gpu makes to present to, sized to the frame (3840x2160 for this title) and placed by Windows. The placement moves to victory-gpu's window module: in "title" mode that window is now fitted to the work area and centred, "<width>x<height>" sets its client area, "fullscreen" makes it a borderless popup over the primary screen. It is created hidden and shown once its client size is right. The title's own windows only keep the existing shrink-to-the-screen fit: the title may read back its client size or styles, so they are not resized or restyled.

Closing that window (close button, Alt+F4, the taskbar) now ends the title through the same suspend path as closing the title's window, via a callback victory-hle registers; before, the window was destroyed and the title ran on without one. The window menu (Alt, F10) is ignored, so the keyboard pad cannot drive it.

(cherry picked from commit f036d84e77868a3b14850157e502377c70aee7a9)

AI-assisted (Claude Code)
The window we present in and the title's own top-level windows take their caption from VICTORY_CAPTION when it is set, so a shared screen can show a neutral one. A title window made with CreateWindowExA gets it in the ANSI code page, as that call expects. The frame meter in the caption no longer adds the project's name; it follows whatever the caption is.

(cherry picked from commit 23e52663159edb528295545a75881735fa6a0623)

AI-assisted (Claude Code)
The caption test assumed a single-byte ANSI code page and failed on a
double-byte one such as 936, where the accented letter takes two bytes.
The encoder now takes its code page, a new test checks the bytes for
1252, 936 and UTF-8 on any machine, and the length check on the active
code page runs only when that code page is single-byte.

AI-assisted (Claude Code)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:46:04 +00:00
Author
Owner

@⁠Revens2 on GitHub · 2026-11-25 07:38 UTC · original

Duplicate of #434: @⁠sennecools opened this patch 77 minutes earlier, and gh pr diff returns the same bytes for both (+1108/-85 on 15 file(s), same title).

The original also carries the author's description, which this PR does not.

Please continue in #434 so the review history and any test data stay in one place.
Thanks.

**@⁠Revens2** on GitHub · 2026-11-25 07:38 UTC · [original](https://github.com/fxceless/victory-fork/pull/548#issuecomment-7156090962) Duplicate of #434: @⁠sennecools opened this patch 77 minutes earlier, and `gh pr diff` returns the same bytes for both (+1108/-85 on 15 file(s), same title). The original also carries the author's description, which this PR does not. Please continue in #434 so the review history and any test data stay in one place. Thanks.
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/Cargo.toml
  • crates/victory-gpu/src/lib.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-548'
git switch 'github-bot/gh-548'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-548'
git switch 'github-bot/gh-548'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-548'
git switch 'main'
git merge --squash 'github-bot/gh-548'
git switch 'main'
git merge --ff-only 'github-bot/gh-548'
git switch 'main'
git merge 'github-bot/gh-548'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.