Title bar follows the system dark or light theme (VICTORY_DARK_TITLE, on by default) #1788
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!1788
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1788"
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?
@Jesper-Andersson on GitHub · 2026-11-29 00:05 UTC · original
Jesper-Andersson:pr/dark-title→main· +184 −0 · 5 files · 2 commits · merged 2026-11-29 08:16 UTCTested in game: the title bar was dark on a Windows 11 dark-theme desktop (checked by eye on 2026-11-29, RTX 2070 SUPER). This ran on our branch, which has the same commits merged onto our own base, not on this PR branch itself. A live theme switch while the game runs was not tested.
On by default.
VICTORY_DARK_TITLE=0turns it off.Relates to: no issue; this PR is my claim for the idea.
What it changes
The game window's caption stayed light on a dark-mode desktop. It now follows the system's apps theme.
Behaviour change: on by default.
VICTORY_DARK_TITLE=0turns it off and leaves the window as it was.crates/victory-hle/src/modules/theme.rs), the apps theme is read fromHKCU\Software\Microsoft\Windows\CurrentVersion\Themes\PersonalizeAppsUseLightTheme(0 is dark; a missing value counts as light). It is passed toDwmSetWindowAttributewithDWMWA_USE_IMMERSIVE_DARK_MODE(20), with a fallback to 19 for Windows 10 before 20H1.SetWindowPoswithSWP_FRAMECHANGED | NOMOVE | NOSIZE | NOZORDER | NOACTIVATEfollows.WM_SETTINGCHANGEwith"ImmersiveColorSet"(top-level window only), so a theme switch while the game runs shows at once.VICTORY_DARK_TITLE: unset orautofollows the system,1is always dark,0is off.windows-sysgainsWin32_Graphics_DwmandWin32_System_Registry. No new crate, and no dependency on the window icon PR.docs/findings.md.The caption exists only in the default windowed mode. With
VICTORY_FULLSCREEN=1the window becomes a popup with no caption, so this has no visible effect there. The check above was in the default windowed mode. Borderless was not tested.Nothing from the game is involved: the code holds only system API names and our own switch name.
Sources (Microsoft Learn): "Support Dark and Light themes in Win32 apps", DwmSetWindowAttribute and DWMWINDOWATTRIBUTE (DWMWA_USE_IMMERSIVE_DARK_MODE), WM_SETTINGCHANGE, RegGetValueW.
How it was tested
cargo testpassed for the crates it touches: yes: 203 passed, 0 failed, 3 ignored, plusno_dll_planting1 passed (-p victory-hle; the unit tests cover the registry value mapping, the switch and the setting name).cargo clippy -p victory-hle --all-targets: no warnings in victory-hle (the warnings that remain are main's own, in victory-shader and victory-gpu, so-D warningsstops there before reaching this crate).cargo xtask policy: fails only on upstream's owncrates/victory-shader/src/emit/lower.rs(667,523 bytes, over the 655,360-byte limit; the same on main, see #1429/#1493/#1527). This PR does not touch that file, and every changed file passes.Checked for overlap
lifecycle.rs). Related: none sets the caption theme. #1002, #1009, #1067 and #753 also change the window procedure inlifecycle.rs. This PR adds a few lines there (theme::applyinhook, and theWM_SETTINGCHANGEhandling). Companion PR (separate, independent, touches the same two spots inlifecycle.rs): the window icon,pr/window-icon.This was written with AI assistance (Claude Code).