fix(crash): the crash window's middle button reads "Log folder", drawn whole on a scaled screen #1062

Open
d4nkn3ss wants to merge 2 commits from d4nkn3ss/Longshot:fix/crash-window-button-label into main
Contributor

Type: fix · Risk: low · Tested on: Windows 11, RTX 3080 · Needs: Linux, any GPU

Why

On a scaled Windows screen the crash window's middle button reads "pen the log fold": its label, "Open the log folder", is cut at both ends. A player who just had a crash sees a broken window. SDL's message box gives every button the width the longest label needs, and it measures that label narrower than it draws it. Changing the helper's DPI awareness made no difference (tried; see #1058). Fixes #1058.

How to reproduce

Seen on: Windows 11, RTX 3080 (NVIDIA 621.14), a 4K screen with display scaling on
Settings and switches: none
Steps: show the crash window: longshot --crash-show <record> <game folder> <log> <options> with a crash record in <game folder>/bug-reports/pending, or start after a crash
Expected: three buttons, each label whole
Actual: "Report", "pen the log fold", "Close"

What changed

The middle button's label is "Log folder", which is drawn whole at the same scale. It does the same thing as before.

  • host: host/hos_crash_dialog.c show(): {"Report", "Log folder", "Close"}, with a comment saying why the labels stay short. The file's header comment follows.
  • docs: docs/common-issues.md and docs/development.md name the button as it now reads.
  • tests: tests/test_crash_buttons.py (new): reads show()'s three labels and wants each at 12 characters or fewer. It fails on main. tests/test_crash_dialog.py: one assertion message names the button anew (its check is unchanged).

Measurements

Verdict: fixed: the button reads "Log folder", whole, where main shows "pen the log fold".

Hardware: Windows 11 Pro 26300, RTX 3080 10 GB (NVIDIA 621.14), i9-12900K, 64 GB, a 4K screen with display scaling (the window 2844 px wide)
Scene: the crash window, shown with --crash-show from a scratch game folder's crash record and log
Method: each build's longshot.exe, its window captured (the window's rectangle only)
Baseline: main's side is main @ 1764fed2's build; this PR is on main @ bbe421f5. git diff 1764fed2 bbe421f5 -- host/hos_crash_dialog.c is empty.
How to reproduce: the steps above on a scaled screen

the window's three buttons Before: main @ 1764fed2 After: this PR @ a1f80028
labels as drawn Report, "pen the log fold", Close Report, Log folder, Close
python -I -B tests/test_crash_buttons.py
main:     FAIL: the crash window's buttons ['Report', 'Open the log folder', 'Close']: over 12 characters: ['Open the log folder']
this PR:  OK: the crash window's buttons ['Report', 'Log folder', 'Close'], each 12 characters or fewer

Flags and settings

None

Testing

Tested:

  • The crash window of this PR's exe (built from a1f80028) and of main's, as above.
  • python -I -B tests/run_all.py from PowerShell with llvm-mingw from the Longshot Builder: 603 passed, 19 failed, 42 skipped. The 19 fail on main too: test_auto_handheld, test_bug_report_defaults, test_crash_dialog (on Windows; #1012), test_crt_options, test_fsr_uniform_ownership, test_guest_imported, test_import_reach, test_linux_preflight, test_make_game_cache, test_missing_nup, test_pads_after_menu, test_parallel_init_order, test_pending_guest_import, test_release, test_replay_write_order, test_run_all_changed, test_tested_configurations, test_vk_occlusion_queries and test_walk_key.

Not tested: Linux's message box (SDL there too), and an unscaled Windows screen, where the old label already fit.

Must be tested:

  • Linux, any GPU: build the host, then python -I -B tests/run_all.py test_crash_buttons test_crash_dialog, expecting both to pass (by hand: the checks' lines)

Risks

What could break: nothing but the label: the button does the same thing.

Turning it off: revert the commit.

Compatibility: The crash window's middle button reads "Log folder".

Issues

Fixes #1058

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named).
  • 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.

When it applies

  • 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.

🤖 Generated with Claude Code

**Type:** fix · **Risk:** low · **Tested on:** Windows 11, RTX 3080 · **Needs:** Linux, any GPU ## Why On a scaled Windows screen the crash window's middle button reads "pen the log fold": its label, "Open the log folder", is cut at both ends. A player who just had a crash sees a broken window. SDL's message box gives every button the width the longest label needs, and it measures that label narrower than it draws it. Changing the helper's DPI awareness made no difference (tried; see #1058). Fixes #1058. ## How to reproduce **Seen on:** Windows 11, RTX 3080 (NVIDIA 621.14), a 4K screen with display scaling on **Settings and switches:** none **Steps:** show the crash window: `longshot --crash-show <record> <game folder> <log> <options>` with a crash record in `<game folder>/bug-reports/pending`, or start after a crash **Expected:** three buttons, each label whole **Actual:** "Report", "pen the log fold", "Close" ## What changed The middle button's label is "Log folder", which is drawn whole at the same scale. It does the same thing as before. - host: `host/hos_crash_dialog.c` `show()`: `{"Report", "Log folder", "Close"}`, with a comment saying why the labels stay short. The file's header comment follows. - docs: `docs/common-issues.md` and `docs/development.md` name the button as it now reads. - tests: `tests/test_crash_buttons.py` (new): reads `show()`'s three labels and wants each at 12 characters or fewer. It fails on main. `tests/test_crash_dialog.py`: one assertion message names the button anew (its check is unchanged). ## Measurements **Verdict:** fixed: the button reads "Log folder", whole, where main shows "pen the log fold". Hardware: Windows 11 Pro 26300, RTX 3080 10 GB (NVIDIA 621.14), i9-12900K, 64 GB, a 4K screen with display scaling (the window 2844 px wide) Scene: the crash window, shown with `--crash-show` from a scratch game folder's crash record and log Method: each build's `longshot.exe`, its window captured (the window's rectangle only) Baseline: main's side is main @ 1764fed2's build; this PR is on main @ bbe421f5. `git diff 1764fed2 bbe421f5 -- host/hos_crash_dialog.c` is empty. How to reproduce: the steps above on a scaled screen | the window's three buttons | Before: main @ 1764fed2 | After: this PR @ a1f80028 | |---|---|---| | labels as drawn | Report, "pen the log fold", Close | Report, Log folder, Close | ``` python -I -B tests/test_crash_buttons.py main: FAIL: the crash window's buttons ['Report', 'Open the log folder', 'Close']: over 12 characters: ['Open the log folder'] this PR: OK: the crash window's buttons ['Report', 'Log folder', 'Close'], each 12 characters or fewer ``` ### Flags and settings None ## Testing **Tested:** - The crash window of this PR's exe (built from a1f80028) and of main's, as above. - `python -I -B tests/run_all.py` from PowerShell with llvm-mingw from the Longshot Builder: 603 passed, 19 failed, 42 skipped. The 19 fail on main too: `test_auto_handheld`, `test_bug_report_defaults`, `test_crash_dialog` (on Windows; #1012), `test_crt_options`, `test_fsr_uniform_ownership`, `test_guest_imported`, `test_import_reach`, `test_linux_preflight`, `test_make_game_cache`, `test_missing_nup`, `test_pads_after_menu`, `test_parallel_init_order`, `test_pending_guest_import`, `test_release`, `test_replay_write_order`, `test_run_all_changed`, `test_tested_configurations`, `test_vk_occlusion_queries` and `test_walk_key`. **Not tested:** Linux's message box (SDL there too), and an unscaled Windows screen, where the old label already fit. **Must be tested:** - Linux, any GPU: build the host, then `python -I -B tests/run_all.py test_crash_buttons test_crash_dialog`, expecting both to pass (by hand: the checks' lines) ## Risks **What could break:** nothing but the label: the button does the same thing. **Turning it off:** revert the commit. **Compatibility:** The crash window's middle button reads "Log folder". ## Issues Fixes #1058 ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). - [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. ### When it applies - [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. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
SDL's message box gives every button the width the longest label needs and,
on a scaled Windows screen, measures the text narrower than it draws it: the
crash window's "Open the log folder" was cut to "pen the log fold" (issue
1058). This check reads show()'s three labels and wants each at 12
characters or fewer; it fails on main.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
fix(crash): the crash window's middle button reads "Log folder", drawn whole on a scaled screen
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 3s
a1f80028c0
On a scaled Windows screen SDL's message box cut "Open the log folder" to
"pen the log fold" (issue 1058): it sizes every button for the longest
label and measures that label narrower than it draws it. "Log folder" is
drawn whole there, with the other two. The docs that name the button follow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Contributor

Tested in game: Windows 11, RTX 3080 (NVIDIA 621.14), 4K screen with display scaling: the crash window of this build's longshot.exe (a1f80028) via --crash-show shows Report, Log folder, Close whole; main's cuts the middle one to 'pen the log fold'

Tested in game: Windows 11, RTX 3080 (NVIDIA 621.14), 4K screen with display scaling: the crash window of this build's longshot.exe (a1f80028) via --crash-show shows Report, Log folder, Close whole; main's cuts the middle one to 'pen the log fold'
d4nkn3ss changed title from WIP: fix(crash): the crash window's middle button reads "Log folder", drawn whole on a scaled screen to fix(crash): the crash window's middle button reads "Log folder", drawn whole on a scaled screen 2026-11-16 05:37:09 +00:00
Member

Code-only review of a1f80028c0; informational findings, with final approval left to another reviewer.

No introduced correctness defect found. The change preserves the button IDs, Report/Close behavior, the log-folder action and the native fallback; it only shortens the displayed label and updates its documentation.

The author reports a successful before/after check on scaled Windows 11. The remaining Linux checks explicitly listed under Must be tested still need results. Please also attach the already captured before/after window images to the description, as required for this visible change. The new character-count check catches restoration of the old label, but cannot establish rendered width across fonts or display scales; its 12-character limit is a source guard, not a general clipping guarantee.

Merge coordination: PR 141 and PR 983 replace this dialog's button array with reporting options. Preserve the short log-folder label and adapt this new source-extraction check when integrating either replacement.

Read the complete diff, dialog dispatch/fallback, existing action test, new label check and overlapping dialog changes. No tests, builds or application runs performed.

Code-only review of a1f80028c0714941cb6c0b2cbceabf923fe75dbc; informational findings, with final approval left to another reviewer. No introduced correctness defect found. The change preserves the button IDs, Report/Close behavior, the log-folder action and the native fallback; it only shortens the displayed label and updates its documentation. The author reports a successful before/after check on scaled Windows 11. The remaining Linux checks explicitly listed under **Must be tested** still need results. Please also attach the already captured before/after window images to the description, as required for this visible change. The new character-count check catches restoration of the old label, but cannot establish rendered width across fonts or display scales; its 12-character limit is a source guard, not a general clipping guarantee. Merge coordination: [PR 141](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/141) and [PR 983](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/983) replace this dialog's button array with reporting options. Preserve the short log-folder label and adapt this new source-extraction check when integrating either replacement. Read the complete diff, dialog dispatch/fallback, existing action test, new label check and overlapping dialog changes. No tests, builds or application runs performed.
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 3s
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
Some workflows are waiting to be reviewed.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix/crash-window-button-label:d4nkn3ss-fix/crash-window-button-label'
git switch 'd4nkn3ss-fix/crash-window-button-label'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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!1062
No description provided.