fix(vk): Auto (this PC) reads the primary monitor when there's no window, so an update no longer lowers the resolution #176
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/upscaling
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
testing wanted
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!176
Loading…
Reference in a new issue
No description provided.
Delete branch "d4nkn3ss/Longshot:fix/auto-screen-without-window"
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?
Why
Updating a game folder with the Builder could lower the player's resolution on Windows: the update's shader preparation has no window, so "Auto (this PC)" saw a 0x0 screen, decided the hardware had changed, chose again and wrote that over the player's settings (#165: 2560x1440 became 2048x1152). A headless start did the same.
What changed
auto_profile()ingpu/vk/vk_main.cpp(Windows) asksMonitorFromWindow(main_window, MONITOR_DEFAULTTOPRIMARY)without first requiring a window: withmain_windowNULL that is the primary monitor. With no window it also takes that monitor's refresh rate, whichdisplay_refresh_mhz()reports as 0 then. With a window, nothing changes: the window's monitor anddisplay_refresh_mhz()as before.display_refresh_mhz()itself is unchanged: frame pacing and frame generation keep their own no-window behaviour.Flags and settings
None
Measurements
main:
fabcd2c0(2026-11-13)this PR: fix/auto-screen-without-window @
a25867e5Hardware: RTX 3080 10 GB, NVIDIA 621.14, i9-12900K, 64 GB RAM, Windows 11; primary screen 2560x1440 at 165 Hz
Scene: n/a: the start's Auto line and
longshot_options.ini, from the same standalone build with main's and this PR'slongshot_vk.dllswapped inMethod: an options file written by a windowed first start (
auto_for=744c6a1e8b5735b7,output_res=2048x1152), copied back before each run; then a headless start (HOS_HEADLESS=1) and a preparation-only start (--prepare-shaders) with each DLL, comparing the options file before and after and the log'svk: Auto (this PC)lineHow to reproduce: start a game folder once normally, then start it with
HOS_HEADLESS=1(or let the Builder update it) and compareauto_for=inlongshot_options.inifabcd2c0a25867e5auto_for=65cf663444a98857auto_for=65cf663444a98857auto_for=744c6a1e8b5735b7, the same as a windowed first startTesting
Tested: the runs above on Windows 11 (main's and this PR's DLL in the same build).
tests/test_auto_settings.pypasses.Full suite:
python -I -B tests/run_all.pyon main @fabcd2c0with this change, Windows 11: 499 passed, 3 failed, 34 skipped; all three fail on main too:tests/test_check_third_party.py(#80),tests/test_release.py(#119, #144, #145) andtests/test_builder_dlss_update.py(its C# fixture doesn't build here: adotnetwithout the SDK).Not tested: Linux:
auto_profile()there still takes the size from the window (desktop_size), so a window-less run fingerprints 0x0 as before; this PR leaves that path alone. Several monitors with the game on a non-primary one: a window-less run takes the primary, so a player whose game window sits on another monitor of a different size would still see Auto choose again.Needs other testers: None
Screenshots
Nothing on screen
Risk and rollback
Only window-less runs change, and only on Windows: they now see the primary monitor where they saw nothing. Reverting the commit is enough.
Issues
Fixes #165
Checklist
For everyone
type(scope): description).main.python -I -B tests/run_all.pyrun and passing (any failure that also fails onmainis named above).third_party/untouched (a new folder with aPROVENANCE.mdinstead).If applicable
Assisted-by:/Co-Authored-By:trailers._WIN32branch; the Linux branch is untouched.)🤖 Generated with Claude Code