diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-27 12:36:06 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-27 12:36:06 +0000 |
| commit | 30178981f487c225901f404040c027d4d1f49fea (patch) | |
| tree | 34c9d0e85cc3b35965d039f2acbf31b339d48915 /bundle/src-tauri/src | |
| parent | c63584c388ea6acb7ad2f244376ae005536b6838 (diff) | |
fix(bundle): allow windows to close and route quit through document cleanup
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'bundle/src-tauri/src')
| -rw-r--r-- | bundle/src-tauri/src/main.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/bundle/src-tauri/src/main.rs b/bundle/src-tauri/src/main.rs index c361260..7dbccd9 100644 --- a/bundle/src-tauri/src/main.rs +++ b/bundle/src-tauri/src/main.rs @@ -117,7 +117,16 @@ fn main() { .build(tauri::generate_context!()) .expect("Could not start CPSC Bundle") .run(|app, event| match event { - // Also reached when macOS terminates without closing windows, such as Dock Quit. + // Dock Quit must run the same document-close flow as the menu and title bar. + tauri::RunEvent::ExitRequested { api, code: None, .. } => { + let windows = app.webview_windows(); + if !windows.is_empty() { + api.prevent_exit(); + for window in windows.into_values() { + let _ = window.close(); + } + } + } tauri::RunEvent::Exit => { let runners: Vec<Runner> = app .state::<Runners>() |
