fix: prevent multiple instances when reopening from desktop icon
Cherry-picked from main (c163435b) cc
This commit is contained in:
1 parent
968a9d7116
commit
700183b0bb
2 files changed
+9
No files matched your search
@@ -276,6 +276,14 @@ pub fn run() {
|
||||
let user_data_paths = user_data::UserDataPaths::new();
|
||||
|
||||
tauri::Builder::default()
|
||||
.plugin(tauri_plugin_single_instance::init(|app, _args, _cwd| {
|
||||
// Second instance launched — bring existing window to front
|
||||
if let Some(window) = app.get_webview_window("main") {
|
||||
let _ = window.show();
|
||||
let _ = window.unminimize();
|
||||
let _ = window.set_focus();
|
||||
}
|
||||
}))
|
||||
.plugin(tauri_plugin_opener::init())
|
||||
.plugin(tauri_plugin_dialog::init())
|
||||
.plugin(tauri_plugin_clipboard_manager::init())
|
||||
|
||||
Reference in new issue
Block a user