Skip to content

WebView2: a closing secondary window keeps its unload delay until its close is posted (#708) - #715

Merged
ambroise-leclerc merged 1 commit into
developfrom
708-suivi-revue-fermeture
Nov 28, 2026
Merged

ambroise-leclerc merged 1 commit into
developfrom
708-suivi-revue-fermeture

Conversation

@ambroise-leclerc

Copy link
Copy Markdown
Collaborator

Refs #708. Answers the review of #712, merged before the comment was handled.

What changes

include/webfront/frontend/WebView2.hpp: Session::finishUnload() stops the unload delay only once PostMessageW has posted the WM_CLOSE that ends the window. Before, it stopped the delay first: a full message queue refused the post, nothing tried again, and while unloading stays true the guard of WM_CLOSE ignores the ordinary requests. The hidden window and its controller then stayed until the first window ended. SetTimer repeats, so the next expiry tries again; the controller is still never closed from a WebView2 callback.

Tests

  • Local (Windows, WebView2, Release): WebView2Lifecycle-second-open, -second-window, -secondary-close and -secondary-startup-timeout, five times each, pass.
  • A full message queue is not provoked by a test: the change keeps the retry that the repeating delay already gives.
  • Codex review: no remark.

… close is posted (#708)

Answers CodeRabbit's review of #712: a full message queue refuses PostMessageW, and finishUnload() had already stopped
the delay, so nothing tried again and the hidden window kept its controller until the first window ended.
@coderabbitai

coderabbitai Bot commented Nov 28, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 32 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8b500edd-41aa-4fb6-b744-8d5c22b43066
Commits

Reviewing files that changed from the base of the PR and between 092be1f and 5d70f2e.

Files selected for processing: 1

  • include/webfront/frontend/WebView2.hpp
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@ambroise-leclerc
ambroise-leclerc merged commit 42ee8ab into develop Nov 28, 2026
25 checks passed
@ambroise-leclerc
ambroise-leclerc deleted the 708-suivi-revue-fermeture branch November 28, 2026 10:23
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