fix(menu): a new install starts at its screen's size where that is smaller than the game's own, and no longer asks to restart #172
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!172
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:fix/auto-output-default"
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
On a new install, opening the menu (F1) and closing it again asks to restart for the Output resolution, which the player never touched. A Steam Deck also only got its own 1280x800 from the second start on.
The cause:
host/hos_main.creads the Output resolution at boot, before the graphics card is known. Auto (this PC) then chose the screen's size, which could only apply at the next start.restart_init()runs once, so its call inmenu_auto_for_gpudid nothing, and the menu still held the 2048x1152 the run started with.What changed
Auto (this PC) no longer sets the Output resolution (
gpu/vk/auto_settings.hchoose,gpu/vk/vk_menu.cppapply_auto). It stays the game's own 2048x1152, or the size the player chose.output_tier,Choice::output_w/hand theauto_output=options key are gone. An old file'sauto_output=line is dropped at the next save.With no Output resolution chosen, a screen smaller than the game's own takes its own size, applied from the very first start with no restart. Examples: a Steam Deck's 1280x800, a 1080p monitor's 1920x1080. The rule is
hos_output_defaultinhost/hos_wide_size.h, used by both:host/nn_applet.coutput_mode, when there is nooutput_res=line and noHOS_OUTPUT_RES; the window, and so the screen's size, exists before the game's thread starts, on Windows and Linux);vk_menu.cppmenu_init, beforeoutputs_syncandrestart_init), so the row, what gets saved and the restart record match what runs.The handheld profile (file or
HOS_HANDHELD) skips it, as before.A restart row Auto still sets (the Profile, docked) is taken as Later (
menu_auto_for_gpu). Closing the menu doesn't ask to restart for Auto's own change. The row still says After restart, and a change of the player's own to any restart row asks again. This replaces therestart_init()call that did nothing.Docs: the README's Output resolution row and Auto paragraph, and
docs/graphics-and-controls.md.Checks:
tests/test_output_resolution.pycompileshos_output_defaultagainst screen sizes (Deck, 1080p, 1366x768, 1920x1200, 1440p, unknown, portrait) and checks the host andmenu_initboth use it beforerestart_init.tests/test_menu_restart.pychecksmenu_auto_for_gputakes Auto's restart rows as Later and doesn't callrestart_init.tests/test_auto_settings.{py,cpp}drop the output expectations and check Auto sets no Output resolution.tests/test_menu_keys.pyandtests/test_menu_env_overrides.pystubs followmenu_init.Flags and settings
output_res=absent)HOS_OUTPUT_RESand a chosenoutput_res=still win. Nothing new to document in the switch reference.Measurements
Not a performance change: no frame time numbers. What it changes is the first start's Output resolution and the restart question, which the game-free checks cover. A run in the game is still to do (Testing).
main:
839e85ff(2026-11-13)this PR: fix/auto-output-default @
04a9f4a6Hardware: Linux (CachyOS), checks only
Scene: none (game-free checks)
Method:
python -I -B tests/run_all.pyHow to reproduce: delete
longshot_options.inifrom the game folder, start the game, open the menu with F1 and close it.839e85ff04a9f4a6tests/run_all.pyAll seven fail on main in the same environment.
Testing
Tested:
python -I -B tests/run_all.pyon Linux. The new and changed checks pass (test_output_resolution,test_menu_restart,test_auto_settings,test_menu_keys,test_menu_env_overrides,test_aspect_default). The 7 failures above also fail on main.Not tested: not run in the game yet. To check: a new install (no
longshot_options.ini) opens and closes the menu with no restart question; the log'soe: output resolutionline and the menu's Output resolution agree; on a 1440p or larger screen the run is at 2048x1152.Needs other testers:
oe: output resolution 1280x800 (none chosen: …)), the menu shows 1280x800, and closing the menu asks no restart (request to open)Screenshots
Nothing on screen beyond the restart question no longer showing; screenshots come with the run in the game.
Risk and rollback
output_res=, so only new installs (or a file without the line) see this.HOS_OUTPUT_RES=2048x1152forces the game's own for a run.Reviewer notes
hos_output_default(host/hos_wide_size.h), then its two callers:nn_applet.coutput_modeandvk_menu.cppmenu_init. Both read the same main-screen size,GetSystemMetrics(the process is DPI-aware fromhos_main.c), or SDL's desktop size on Linux.Issues
None filed: reported directly.
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.mainand passing here.tests/that reads changed source updated in this PR, not weakened.host/nn_applet.cneeds the headers made from the game (a64_suyu.h), and there's no game build here. The change only callsGetSystemMetrics, which the file'swindows.hand the posix shim both have, and adds no paths.)🤖 Generated with Claude Code
WIP: fix(menu): a new install starts at its screen's size where that is smaller than the game's own, and no longer asks to restartto fix(menu): a new install starts at its screen's size where that is smaller than the game's own, and no longer asks to restart