feat(close): first-close choice — tray or quit — and a call guard (#5)
Build Lotus Chat Desktop / prepare (push) Successful in 10s
Build Lotus Chat Desktop / build-linux (push) Successful in 28m46s
Build Lotus Chat Desktop / build-arch (push) Successful in 14s
Build Lotus Chat Desktop / build-windows (push) Successful in 38m32s
Build Lotus Chat Desktop / update-manifest (push) Successful in 9s

Closing the window (OS close button or the custom title bar's ×) now
goes through one handler:
- in a call → always hide to the tray (a close must never drop a call);
- saved "tray" → hide; "quit" → exit the app;
- "ask" (the default until chosen) → emit `lotus-close-requested` so the
  web client shows the one-time dialog; if the page isn't listening yet,
  fall back to the tray.
The choice lives in `close-behavior` in the app config dir;
get_close_behavior / set_close_behavior / resolve_close_request back the
dialog and the Settings select.

Verified on Linux under Xvfb + openbox with real WM close requests
(wmctrl -c): tray → hidden, still running; quit → exits; unset with no
page listening → hidden; ask with the page listening → window stays,
page receives the event; quit during a call → hidden, still running.

Bump cinny (the dialog + Settings control).

Closes #5

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA
This commit is contained in:
Lotus CI
2026-09-24 12:51:28 -04:00
co-authored by Claude Opus 5.5
parent d6a64695bf
commit 71ab1afdaf
3 changed files with 121 additions and 5 deletions
+3 -3
View File
@@ -79,7 +79,7 @@ pub fn window_start_drag(app: AppHandle) {
/// single explicit quit path.
#[tauri::command]
pub fn window_close(app: AppHandle) {
if let Some(window) = app.get_webview_window("main") {
let _ = window.hide();
}
// Same rules as the OS close button (tray / quit / first-close dialog,
// cinny-desktop #5).
crate::handle_close_request(&app);
}