macOS find: page matches drawn with the CSS Custom Highlight API (window.find showed nothing while the page was not the key view); --diag logs exit requests, window close/destroy and each native pane placement on macOS
This commit is contained in:
parent
6d6e6c5b62
commit
b13849da99
4 changed files with 113 additions and 36 deletions
|
|
@ -699,7 +699,7 @@ async fn tab_zoom(webview: Webview, app: AppHandle, id: String, factor: Option<f
|
|||
|
||||
/// Find in page for tab `id` (the shell's find bar): `start` with a query, `next`, `previous`, `stop`.
|
||||
/// The engine's own find where this build can drive it (counts arrive as `tab-find` events), else the
|
||||
/// evaluated `window.find`. The query is one typed line (validated) and is kept nowhere.
|
||||
/// evaluated Custom Highlight script. The query is one typed line (validated) and is kept nowhere.
|
||||
#[tauri::command]
|
||||
async fn tab_find(webview: Webview, app: AppHandle, id: String, action: String, query: Option<String>) -> Result<(), String> {
|
||||
shell_only(&webview)?;
|
||||
|
|
@ -1454,8 +1454,22 @@ impl App {
|
|||
handler(invoke)
|
||||
}
|
||||
})
|
||||
.run(context)
|
||||
.unwrap_or_else(|error| panic!("Failed to launch {}: {error}", config.title));
|
||||
.build(context)
|
||||
.unwrap_or_else(|error| panic!("Failed to launch {}: {error}", config.title))
|
||||
.run(|_, event| log_run_event(&event));
|
||||
}
|
||||
}
|
||||
|
||||
/// Why the app is going away, for `--diag` ([`crate::diag`]): an exit request with its code (None is a
|
||||
/// polite quit from outside: Cmd+Q, the Dock, or another app such as an auto-quitter closing the last
|
||||
/// window), window close/destroy events and the final exit. Nothing is written without diagnostics.
|
||||
fn log_run_event(event: &tauri::RunEvent) {
|
||||
match event {
|
||||
tauri::RunEvent::ExitRequested { code, .. } => crate::diag::log("host", &format!("exit requested code={code:?}")),
|
||||
tauri::RunEvent::Exit => crate::diag::log("host", "exit"),
|
||||
tauri::RunEvent::WindowEvent { label, event: tauri::WindowEvent::CloseRequested { .. }, .. } => crate::diag::log("host", &format!("window {label} close requested")),
|
||||
tauri::RunEvent::WindowEvent { label, event: tauri::WindowEvent::Destroyed, .. } => crate::diag::log("host", &format!("window {label} destroyed")),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue