fix(tray): make quit action terminate app
这个提交存在于:
父节点
16b66d3435
当前提交
e0ef4230ff
共有 2 个文件被更改,包括 16 次插入 和 1 次删除
|
|
@ -214,3 +214,9 @@ Still not claimed complete: automatic startup activation, real Tauri multi-windo
|
||||||
- Added explicit pet-view root sizing and transparent `html`/`body`/`#root` backgrounds so Tauri transparent windows do not fall back to an opaque blank surface.
|
- Added explicit pet-view root sizing and transparent `html`/`body`/`#root` backgrounds so Tauri transparent windows do not fall back to an opaque blank surface.
|
||||||
- Validation: TypeScript, ESLint, Vitest (6), Vite build, Rust format, Clippy with warnings denied, Rust workspace tests (66), and NSIS bundle build pass.
|
- Validation: TypeScript, ESLint, Vitest (6), Vite build, Rust format, Clippy with warnings denied, Rust workspace tests (66), and NSIS bundle build pass.
|
||||||
- The already-running executable must be fully closed and relaunched; the generated installer is at `target/release/bundle/nsis/AstrBot Desktop_0.1.0-alpha.1_x64-setup.exe`.
|
- The already-running executable must be fully closed and relaunched; the generated installer is at `target/release/bundle/nsis/AstrBot Desktop_0.1.0-alpha.1_x64-setup.exe`.
|
||||||
|
|
||||||
|
## 2026-07-20: tray quit reliability fix
|
||||||
|
|
||||||
|
- Fixed the tray Quit action so it destroys the main, quick-chat, status-bubble, and pet windows before requesting process exit.
|
||||||
|
- This avoids the global close-to-tray handler intercepting shutdown and leaving the process resident.
|
||||||
|
- Validation: Rust format, Clippy with warnings denied, Rust workspace tests (66), TypeScript, ESLint, Vitest (6), and NSIS bundle build pass.
|
||||||
|
|
|
||||||
|
|
@ -156,6 +156,15 @@ fn save_quick_window_state(window: &tauri::Window, app: &AppHandle) {
|
||||||
let _ = database.save_window_state(QUICK_WINDOW_ID, &state);
|
let _ = database.save_window_state(QUICK_WINDOW_ID, &state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn exit_application(app: &AppHandle) {
|
||||||
|
for label in ["main", QUICK_WINDOW_ID, "status-bubble", PET_WINDOW_ID] {
|
||||||
|
if let Some(window) = app.get_webview_window(label) {
|
||||||
|
let _ = window.destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
app.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
fn open_main_window(app: AppHandle) -> Result<(), String> {
|
fn open_main_window(app: AppHandle) -> Result<(), String> {
|
||||||
let window = app
|
let window = app
|
||||||
|
|
@ -261,7 +270,7 @@ pub fn run() {
|
||||||
let _ = window.set_focus();
|
let _ = window.set_focus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"quit" => app.exit(0),
|
"quit" => exit_application(app),
|
||||||
_ => {}
|
_ => {}
|
||||||
})
|
})
|
||||||
.build(app)?;
|
.build(app)?;
|
||||||
|
|
|
||||||
正在加载…
添加表格
在新工单中引用