INNER CODE UNIT · Rust
run
zevnda/steam-game-idler · src-tauri/src/lib.rs:36
pub fn run() {
tauri::Builder::default()
// Must be registered first so it can intercept startup before any other plugin/setup
// runs on a second launch attempt (Tauri's own recommendation for this plugin).
.plugin(tauri_plugin_single_instance::init(|app, _args, _cwd| {
tracing::info!(
"single-instance: second launch attempt intercepted, focusing existing window"
);
if let Some(window) = app.get_webview_window("main") {
if let Err(e) = window.show() {
tracing::warn!(error = %e, "single-instance: failed to show main window");
}
if let Err(e) = window.set_focus() {
tracing::warn!(error = %e, "single-instance: failed to focus main window");
}
}
}))
.plugin({