Lifecycle: a WM_CLOSE to the window ends the title, as the close button does (#726) #753

Manually merged
github merged 1 commit from github-bot/gh-753 into main 2026-11-29 08:21:52 +00:00 AGit
Owner

@⁠kibagami-nc on GitHub · 2026-11-28 04:58 UTC · original
kibagami-nc:fix/wm-close-ends-the-title → main · +36 −4 · 1 files · 1 commits · merged 2026-11-29 08:16 UTC

Fixes finding 1 of #726's test report.

What happens

The layer ends the title only on the user's close: WM_SYSCOMMAND with SC_CLOSE, from the close button, Alt+F4, or the window or taskbar menu.

A plain WM_CLOSE from another program goes on to the title's own procedure instead. Such programs include Process.CloseMainWindow, taskkill without /F, and launcher scripts. The procedure destroys the window, but the title keeps presenting to it and the process never ends. Until the process is killed, Streamline logs getRefreshRate ... Window handle ... is not a valid window at every present (#726).

The change

  • close_request says which messages ask the window to close:
    • the user's SC_CLOSE, as before;
    • a WM_CLOSE to the top-level window.
  • window_proc ends the title for both through the same end_title (suspend, then end).
  • The log says window closed (WM_CLOSE) for the second, so the two can be told apart.
  • A child window's WM_CLOSE is passed on to the title as before.

Tests

  • New test modules::lifecycle::tests::closes_asked_of_the_window_end_the_title:
    • close requests: SC_CLOSE (also with the system's low bits set) and a top-level WM_CLOSE;
    • not close requests: a child window's WM_CLOSE, SC_KEYMENU, SC_MINIMIZE, SC_MAXIMIZE, WM_DESTROY, WM_NCDESTROY and WM_SIZE;
    • it fails without the WM_CLOSE arm.
  • The test does not send a WM_CLOSE through the window procedure itself, since ending the title ends the process.
  • cargo test -p victory-hle --lib --locked: 189 passed.
  • Clippy (default and --all-features) reports nothing in lifecycle.rs; main's own lints are in #665.

Not run in the game here.

**@⁠kibagami-nc** on GitHub · 2026-11-28 04:58 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/753) `kibagami-nc:fix/wm-close-ends-the-title` → `main` · +36 −4 · 1 files · 1 commits · merged 2026-11-29 08:16 UTC Fixes finding 1 of #726's test report. ## What happens The layer ends the title only on the user's close: `WM_SYSCOMMAND` with `SC_CLOSE`, from the close button, Alt+F4, or the window or taskbar menu. A plain `WM_CLOSE` from another program goes on to the title's own procedure instead. Such programs include `Process.CloseMainWindow`, `taskkill` without `/F`, and launcher scripts. The procedure destroys the window, but the title keeps presenting to it and the process never ends. Until the process is killed, Streamline logs `getRefreshRate ... Window handle ... is not a valid window` at every present (#726). ## The change - `close_request` says which messages ask the window to close: - the user's `SC_CLOSE`, as before; - a `WM_CLOSE` to the top-level window. - `window_proc` ends the title for both through the same `end_title` (suspend, then end). - The log says `window closed (WM_CLOSE)` for the second, so the two can be told apart. - A child window's `WM_CLOSE` is passed on to the title as before. ## Tests - New test `modules::lifecycle::tests::closes_asked_of_the_window_end_the_title`: - close requests: `SC_CLOSE` (also with the system's low bits set) and a top-level `WM_CLOSE`; - not close requests: a child window's `WM_CLOSE`, `SC_KEYMENU`, `SC_MINIMIZE`, `SC_MAXIMIZE`, `WM_DESTROY`, `WM_NCDESTROY` and `WM_SIZE`; - it fails without the `WM_CLOSE` arm. - The test does not send a `WM_CLOSE` through the window procedure itself, since ending the title ends the process. - `cargo test -p victory-hle --lib --locked`: 189 passed. - Clippy (default and `--all-features`) reports nothing in `lifecycle.rs`; main's own lints are in #665. Not run in the game here.
Only the user's close (WM_SYSCOMMAND with SC_CLOSE) ended the title. A
WM_CLOSE from another program (Process.CloseMainWindow, taskkill
without /F) went on to the title's procedure, which destroyed the
window; the title kept presenting to it and the process never ended,
Streamline logging an invalid window handle at every present (#726).

A WM_CLOSE to the top-level window now suspends and ends the title as
the close button does, logged as "window closed (WM_CLOSE)". A child
window's WM_CLOSE is passed on as before. The test checks which
messages are close requests; the window procedure is not driven with
one, since ending the title ends the process.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 05:03:12 +00:00
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-28 05:13 UTC · original · approved these changes

LGTM — verified on Windows:

  • cargo test -p victory-hle --lib lifecycle passed (12/12, including closes_asked_of_the_window_end_the_title)
  • 0 new compiler warnings in touched files
  • cargo xtask policy passed (294 files ok)

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

**@⁠Dukestar69** on GitHub · 2026-11-28 05:13 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/753#pullrequestreview-6095959452) · **approved these changes** LGTM — verified on Windows: - `cargo test -p victory-hle --lib lifecycle` passed (12/12, including `closes_asked_of_the_window_end_the_title`) - 0 new compiler warnings in touched files - `cargo xtask policy` passed (`294 files ok`) Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
github manually merged commit aa24adcfc0 into main 2026-11-29 08:21:52 +00:00
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
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
github/trustno1-coder--VIctory-NVIDIA!753
No description provided.