desktop: a second --hidden start stays in the tray (single-instance no longer opens the window)
This commit is contained in:
parent
a850ba6670
commit
4b6c28aff2
2 changed files with 5 additions and 2 deletions
|
|
@ -322,8 +322,9 @@ pub fn run() {
|
|||
early_trace();
|
||||
linux_webkit_env();
|
||||
let app = tauri::Builder::default()
|
||||
// single-instance first: a second start (or a storebound:// link) focuses the running app instead
|
||||
.plugin(tauri_plugin_single_instance::init(|app, _argv, _cwd| show_main(app)))
|
||||
// single-instance first: a second start (or a storebound:// link) focuses the running app instead; a second
|
||||
// logon start (--hidden: the Run entry plus a Startup folder shortcut) stays in the tray
|
||||
.plugin(tauri_plugin_single_instance::init(|app, argv, _cwd| if !argv.iter().any(|a| a == "--hidden") { show_main(app) }))
|
||||
.plugin(tauri_plugin_deep_link::init())
|
||||
// never restore "visible": a --hidden start would otherwise pop the window up
|
||||
.plugin(tauri_plugin_window_state::Builder::new().with_filter(|label| !label.starts_with(menu_panel::LABEL_PREFIX)).with_state_flags(tauri_plugin_window_state::StateFlags::all() & !tauri_plugin_window_state::StateFlags::VISIBLE).build())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue