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

Merged
HumanBean merged 1 commit from HumanBean/Longshot:fix/auto-output-default into main 2026-11-13 09:49:09 +00:00
Owner

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.c reads 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 in menu_auto_for_gpu did 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.h choose, gpu/vk/vk_menu.cpp apply_auto). It stays the game's own 2048x1152, or the size the player chose. output_tier, Choice::output_w/h and the auto_output= options key are gone. An old file's auto_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_default in host/hos_wide_size.h, used by both:

    • the host at boot (host/nn_applet.c output_mode, when there is no output_res= line and no HOS_OUTPUT_RES; the window, and so the screen's size, exists before the game's thread starts, on Windows and Linux);
    • the menu's first start (vk_menu.cpp menu_init, before outputs_sync and restart_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 the restart_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.py compiles hos_output_default against screen sizes (Deck, 1080p, 1366x768, 1920x1200, 1440p, unknown, portrait) and checks the host and menu_init both use it before restart_init.
    • tests/test_menu_restart.py checks menu_auto_for_gpu takes Auto's restart rows as Later and doesn't call restart_init.
    • tests/test_auto_settings.{py,cpp} drop the output expectations and check Auto sets no Output resolution.
    • tests/test_menu_keys.py and tests/test_menu_env_overrides.py stubs follow menu_init.

Flags and settings

Flag What it does Default now Recommendation Helps on Doesn't help on Untested on
Output resolution's default (output_res= absent) The screen's size where it has fewer pixels than 2048x1152; else 2048x1152. Auto (this PC) no longer sets it On On: the game draws no more than the screen shows, and the first start needs no restart Steam Deck (1280x800), 1080p and smaller screens Screens of 2048x1152 or more: 2048x1152 now, where Auto chose the screen's size before (2560x1440, 4K) Every OS in the game (not run yet)

HOS_OUTPUT_RES and a chosen output_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 @ 04a9f4a6
Hardware: Linux (CachyOS), checks only
Scene: none (game-free checks)
Method: python -I -B tests/run_all.py
How to reproduce: delete longshot_options.ini from the game folder, start the game, open the menu with F1 and close it.

main @ 839e85ff this PR @ 04a9f4a6
New install, open and close the menu Asks to restart for the Output resolution Not run in the game yet
tests/run_all.py 7 failures (below) 460 passed, the same 7 failures, 69 skipped
FAIL tests/test_bake_portability.py          (No module named 'zstandard')
FAIL tests/test_builder_log_read_only.py     (libtk8.6.so missing)
FAIL tests/test_longshot_ctl.py              (read-only /tmp in the sandbox)
FAIL tests/test_control.py
FAIL tests/test_program_cache_cleanup.py
FAIL tests/test_program_cache_one_variant.py
FAIL tests/test_vram_budget_row.py

All seven fail on main in the same environment.

Testing

Tested: python -I -B tests/run_all.py on 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's oe: output resolution line and the menu's Output resolution agree; on a 1440p or larger screen the run is at 2048x1152.

Needs other testers:

  • Steam Deck: a new install starts at 1280x800 (oe: output resolution 1280x800 (none chosen: …)), the menu shows 1280x800, and closing the menu asks no restart (request to open)
  • Windows, a 1080p screen: the same at 1920x1080 (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

  • Players on Auto with a 1440p or larger screen and no Output resolution of their own start at 2048x1152, where Auto picked the screen's size before. An existing options file keeps its output_res=, so only new installs (or a file without the line) see this.
  • A screen smaller than 2048x1152 now gets its own size even on another preset.
  • Rollback: revert the commit. HOS_OUTPUT_RES=2048x1152 forces the game's own for a run.

Reviewer notes

  • Start with hos_output_default (host/hos_wide_size.h), then its two callers: nn_applet.c output_mode and vk_menu.cpp menu_init. Both read the same main-screen size, GetSystemMetrics (the process is DPI-aware from hos_main.c), or SDL's desktop size on Linux.
  • Auto's fingerprint still includes the screen's size, so a new screen still makes Auto choose again. Left as is, to avoid re-choosing for every current install.

Issues

None filed: reported directly.

Checklist

For everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description).
  • Rebased on current main.
  • python -I -B tests/run_all.py run and passing (any failure that also fails on main is named above).
  • Tested in the game, or what wasn't is named under Testing.
  • Testing filled in: what was tested, what wasn't, and what needs other testers (with test requests).
  • Measured: main and this PR at named commits, on the same PC, scene and settings, at least 2 interleaved runs each, the median reported. (Not yet: no run in the game. The PR stays WIP until one.)
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

If applicable

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • A game-free test added for the fix, failing on main and passing here.
  • A check under tests/ that reads changed source updated in this PR, not weakened.
  • Docs updated.
  • Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. (Not built yet: host/nn_applet.c needs the headers made from the game (a64_suyu.h), and there's no game build here. The change only calls GetSystemMetrics, which the file's windows.h and the posix shim both have, and adds no paths.)

🤖 Generated with Claude Code

## 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.c` reads 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 in `menu_auto_for_gpu` did 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.h` `choose`, `gpu/vk/vk_menu.cpp` `apply_auto`). It stays the game's own 2048x1152, or the size the player chose. `output_tier`, `Choice::output_w/h` and the `auto_output=` options key are gone. An old file's `auto_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_default` in `host/hos_wide_size.h`, used by both: - the host at boot (`host/nn_applet.c` `output_mode`, when there is no `output_res=` line and no `HOS_OUTPUT_RES`; the window, and so the screen's size, exists before the game's thread starts, on Windows and Linux); - the menu's first start (`vk_menu.cpp` `menu_init`, before `outputs_sync` and `restart_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 the `restart_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.py` compiles `hos_output_default` against screen sizes (Deck, 1080p, 1366x768, 1920x1200, 1440p, unknown, portrait) and checks the host and `menu_init` both use it before `restart_init`. - `tests/test_menu_restart.py` checks `menu_auto_for_gpu` takes Auto's restart rows as Later and doesn't call `restart_init`. - `tests/test_auto_settings.{py,cpp}` drop the output expectations and check Auto sets no Output resolution. - `tests/test_menu_keys.py` and `tests/test_menu_env_overrides.py` stubs follow `menu_init`. ## Flags and settings | Flag | What it does | Default now | Recommendation | Helps on | Doesn't help on | Untested on | |---|---|---|---|---|---|---| | Output resolution's default (`output_res=` absent) | The screen's size where it has fewer pixels than 2048x1152; else 2048x1152. Auto (this PC) no longer sets it | On | On: the game draws no more than the screen shows, and the first start needs no restart | Steam Deck (1280x800), 1080p and smaller screens | Screens of 2048x1152 or more: 2048x1152 now, where Auto chose the screen's size before (2560x1440, 4K) | Every OS in the game (not run yet) | `HOS_OUTPUT_RES` and a chosen `output_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 @ 04a9f4a6 Hardware: Linux (CachyOS), checks only Scene: none (game-free checks) Method: `python -I -B tests/run_all.py` How to reproduce: delete `longshot_options.ini` from the game folder, start the game, open the menu with F1 and close it. | | main @ 839e85ff | this PR @ 04a9f4a6 | |---|---|---| | New install, open and close the menu | Asks to restart for the Output resolution | Not run in the game yet | | `tests/run_all.py` | 7 failures (below) | 460 passed, the same 7 failures, 69 skipped | ``` FAIL tests/test_bake_portability.py (No module named 'zstandard') FAIL tests/test_builder_log_read_only.py (libtk8.6.so missing) FAIL tests/test_longshot_ctl.py (read-only /tmp in the sandbox) FAIL tests/test_control.py FAIL tests/test_program_cache_cleanup.py FAIL tests/test_program_cache_one_variant.py FAIL tests/test_vram_budget_row.py ``` All seven fail on main in the same environment. ## Testing **Tested:** `python -I -B tests/run_all.py` on 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's `oe: output resolution` line and the menu's Output resolution agree; on a 1440p or larger screen the run is at 2048x1152. **Needs other testers:** - Steam Deck: a new install starts at 1280x800 (`oe: output resolution 1280x800 (none chosen: …)`), the menu shows 1280x800, and closing the menu asks no restart (request to open) - Windows, a 1080p screen: the same at 1920x1080 (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 - Players on Auto with a 1440p or larger screen and no Output resolution of their own start at 2048x1152, where Auto picked the screen's size before. An existing options file keeps its `output_res=`, so only new installs (or a file without the line) see this. - A screen smaller than 2048x1152 now gets its own size even on another preset. - Rollback: revert the commit. `HOS_OUTPUT_RES=2048x1152` forces the game's own for a run. ## Reviewer notes - Start with `hos_output_default` (`host/hos_wide_size.h`), then its two callers: `nn_applet.c` `output_mode` and `vk_menu.cpp` `menu_init`. Both read the same main-screen size, `GetSystemMetrics` (the process is DPI-aware from `hos_main.c`), or SDL's desktop size on Linux. - Auto's fingerprint still includes the screen's size, so a new screen still makes Auto choose again. Left as is, to avoid re-choosing for every current install. ## Issues None filed: reported directly. ## Checklist ### For everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`). - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` run and passing (any failure that also fails on `main` is named above). - [x] Tested in the game, or what wasn't is named under Testing. - [x] Testing filled in: what was tested, what wasn't, and what needs other testers (with test requests). - [ ] Measured: main and this PR at named commits, on the same PC, scene and settings, at least 2 interleaved runs each, the median reported. *(Not yet: no run in the game. The PR stays WIP until one.)* - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### If applicable - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] A game-free test added for the fix, failing on `main` and passing here. - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. - [x] Docs updated. - [ ] Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. *(Not built yet: `host/nn_applet.c` needs the headers made from the game (`a64_suyu.h`), and there's no game build here. The change only calls `GetSystemMetrics`, which the file's `windows.h` and the posix shim both have, and adds no paths.)* 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 3s
CI / Workflow lint (actionlint) (pull_request) Successful in 6s
Third-party parts / As their notes say (pull_request) Successful in 6s
PR description / Description follows the template (pull_request_target) Failing after 9s
04a9f4a6b2
The Output resolution is read at boot, before the graphics card is known. Auto (this PC) chose a size afterwards, which only
applied at the next start, so a new install's first close of the menu asked to restart. Auto no longer sets the Output
resolution; with none chosen, the host and the menu take the screen's size where it has fewer pixels than 2048x1152 (a
Steam Deck's 1280x800, a 1080p monitor), from one rule (hos_output_default). A restart row Auto still sets (the Profile)
is taken as Later.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
HumanBean changed title from 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 restart to 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 2026-11-13 09:49:05 +00:00
HumanBean deleted branch fix/auto-output-default 2026-11-13 09:49:10 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
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
MagicBeanDev/Longshot!172
No description provided.