Skip to content

Fix Windows playback hang in the WebView window hook - #205

Closed
Bl4z3-k1n91 wants to merge 1 commit into
Clash-Projects:mainfrom
Bl4z3-k1n91:fix/windows-webview-hook-hang
Closed

Bl4z3-k1n91 wants to merge 1 commit into
Clash-Projects:mainfrom
Bl4z3-k1n91:fix/windows-webview-hook-hang

Conversation

@Bl4z3-k1n91

Copy link
Copy Markdown

Summary

The Windows hook that hides the background WebView now checks window ownership before reading the title. The desktop_webview_window plugin creates those top-level windows on Flutter's platform thread, and the existing caption checks still apply on that thread.

Playback hang on v2.6.2

During playback on Windows 11, two native stack captures showed the platform thread blocked in BotGuardWinEventProc → IsBotGuardWindow → GetWindowTextW → SendMessageW. The target was an OleMainThreadWndClass window owned by libmpv's mpv/wasapi event thread. That thread was waiting in WaitForSingleObjectEx, so it wasn't processing the synchronous WM_GETTEXT request.

Microsoft documents this behavior for a same-process window queried by GetWindowTextW.

Potentially related to #199.

Validation

  • Compiled and ran a local Win32 regression harness using the original and patched predicates. With a worker window temporarily held outside its message loop, the original lookup blocked for 652 ms and delivered one WM_GETTEXT. The patched lookup returned in under 1 ms and delivered zero messages.
  • Confirmed both supported WebView captions still match on the platform thread. An unrelated caption and a null handle are rejected.
  • git diff --check passed.

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