Force tray process to exit if Quit

This commit is contained in:
Luke D. Jones
2024-03-03 22:41:57 +13:00
parent 2f8ea80e6d
commit a1fcf5023c
4 changed files with 131 additions and 153 deletions

View File

@@ -167,7 +167,7 @@ fn main() -> Result<()> {
if let Ok(lock) = config.lock() {
if !lock.run_in_background {
slint::quit_event_loop().unwrap();
return;
exit(0);
}
}

View File

@@ -4,6 +4,7 @@
use std::fs::OpenOptions;
use std::io::{Read, Write};
use std::path::{Path, PathBuf};
use std::process::exit;
use std::sync::{Arc, Mutex};
use std::thread::sleep;
use std::time::Duration;
@@ -108,7 +109,10 @@ pub fn init_tray(
if let TrayEvent::Menu(action) = event {
match action {
TrayAction::Open => open_app(),
TrayAction::Quit => quit_app(),
TrayAction::Quit => {
quit_app();
exit(0);
}
}
}
})