Skip to content

The window comes back when its web engine crashes - #362

Merged
elripalda merged 3 commits into
elripalda:mainfrom
Xarishark:feat/launcher-color-screen-bug-be8e15
Nov 20, 2026
Merged

elripalda merged 3 commits into
elripalda:mainfrom
Xarishark:feat/launcher-color-screen-bug-be8e15

Conversation

@Xarishark

@Xarishark Xarishark commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Sometimes, a few seconds after the launcher starts (often right after an update, while the player clicks a game), the whole window turns one flat colour and stays that way until the launcher is quit from the tray. The colour is the window's background (#0B1220): the WebView2 engine that draws the page has died, and nothing makes it again.

On the PC where this kept happening, all four WebView2 crash dumps (%LOCALAPPDATA%\com.recomplauncher.app\EBWebView\Crashpad\reports) are the same access violation inside RTSSHooks64.dll: RivaTuner Statistics Server (it comes with MSI Afterburner) hooking dxgi.dll in WebView2's main process. When that process dies, every WebView2 process of the launcher goes with it. Other overlays that hook into processes can do the same.

What changes

  • New webview_crash.rs. Each window's WebView2 is watched (add_ProcessFailed) on Windows.
    • The page's process died: the page is loaded again in the same window.
    • The engine died: the main window is made again from its config (remake_main in lib.rs). The launcher process keeps running, so downloads, a game being played and the tray go on; only the page starts over. A window that was hidden in the tray stays hidden. If a game is running it comes back minimized, so it never covers the game, and opens again when the game ends. Big Picture comes back in Big Picture. Place and Text Size are restored as at start.
    • The quick menu and the achievement toast share the engine. Their dead windows are closed and made again the next time they're needed.
    • Slow-to-answer pages and the engine's own helpers (drawing, network, frames) are left alone: WebView2 restarts those itself.
  • No loops. At most one recovery every two minutes and three per run. After that a plain Windows message says the window kept stopping, names RivaTuner (and says it's running, when it is) as the usual cause, and says how to bring it back: the tray icon, or starting the launcher again (show_main makes the window again when it's gone for this reason). While the main window is gone for this reason, a RunEvent::ExitRequested without a code doesn't close the launcher.
  • Every recovery is a line in launcher-trail.log with the reason and exit code, and RivaTuner when it's running, so problem reports show it.
  • Separate commit: the developer test toast (ach_test_toast) is now an async command. As a sync command it ran on the main thread, and its first toast made the toast window there, which deadlocks WebView2 on Windows (the launcher froze). toast() already hands the window work to the main thread, as real achievement toasts do.
  • Linux and macOS are unchanged: only WebView2 reports its engine dying.

Tests

  • webview_crash.rs: the first crash is recovered; one soon after a recovery gives up; one long after is recovered; three recoveries are the most in a run.
  • Linux VM (Bazzite, distrobox): cargo test 898 passed, 1 ignored (on the first commit; the later two weren't rerun there).
  • Windows 11 VM: cargo test 833 passed, 1 ignored. One earlier run failed inputs::tests::the_build_the_step_leaves_has_to_be_there, which passes alone and on the rerun (this PR doesn't touch inputs.rs).
  • Windows 11 VM, in the running app, by ending WebView2's processes:
    • Engine ended: the window comes back drawn, same launcher process; again after more than two minutes; a third time soon after gives the message, and starting the launcher again brings the window back.
    • Page process ended: the page loads again, same engine.
    • Hidden in the tray: made again hidden, opens normally from there.
    • During a download (Ship of Harkinian, throttled): the new page shows its progress and the install finishes.
    • During play (a stand-in game added as the player's own): the window comes back minimized, the game stays in front and keeps running, its playtime is still saved, and the window opens when the game ends.
    • With the quick menu and an achievement toast open over the game: both closed, both come back the next time.
    • In Big Picture: comes back in Big Picture, full screen.
  • Not run: macOS and Linux in the running app (nothing changes there), and a crash from RivaTuner itself (the tests end the processes instead).

Patch notes (Beta 67)

For docs/PATCH-NOTES-0.90-beta-67.md, under Everything else:

  • If the launcher's window went blank (one flat colour) after it started, it now comes back by itself, and downloads and games keep going; if it keeps happening, the launcher says RivaTuner Statistics Server is the usual cause. — Fixed by @Xarishark (#362).

For the website (SDK guide): none.

Not for the player notes (no developer section yet): the test toast in the achievement dev tools no longer freezes the launcher on Windows.

An overlay hooking into WebView2 (RivaTuner Statistics Server) can crash its main process, which left the window one flat colour until the launcher was quit. A page that dies is loaded again; an engine that dies gets the main window made again while the launcher keeps running. At most one recovery every two minutes and three per run, then a message names the likely cause and the tray (or starting the launcher again) brings the window back.
Its web engine dying while a game ran brought the window back minimized, so it wouldn't cover the game, but it then stayed minimized after the game, where before it had been open.
ach_test_toast ran on the main thread, and its first toast makes the toast window there, which deadlocks WebView2 on Windows. As an async command it runs off the main thread, and toast() already hands the window work to the main thread, as real achievement toasts do.
@elripalda
elripalda marked this pull request as ready for review November 20, 2026 21:55
@elripalda
elripalda merged commit a84d564 into elripalda:main Nov 20, 2026
6 checks passed
@Xarishark
Xarishark deleted the feat/launcher-color-screen-bug-be8e15 branch November 23, 2026 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants