Find in page: WebView2 counts its active match from 1; the shell's index is 0-based

Seen live on the shared app: "domain" on example.com showed "2/2" for the first of two matches, and "2 matches" after Next. `ICoreWebView2Find::ActiveMatchIndex` starts at 1 (-1: none); `FindState::from_webview2` converts it (tested), so the bar reads 1/2, then 2/2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
CRTkafa 2026-10-01 03:47:23 +07:00
parent 3450eac09a
commit 5211995694
2 changed files with 18 additions and 1 deletions

View file

@ -221,7 +221,7 @@ mod find_windows {
let _ = find.MatchCount(&mut count);
let _ = find.ActiveMatchIndex(&mut index);
}
emit_shell(app, EVENT_TAB_FIND, FindState { id: id.to_owned(), count, index });
emit_shell(app, EVENT_TAB_FIND, FindState::from_webview2(id, count, index));
}
/// Runs `request` with the engine's find on the main thread; false when this runtime has none.