From 1ccf31f6d76b0e56be4317a2198e7d848d5d369c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Thu, 16 Apr 2026 22:49:30 -0400 Subject: [PATCH] refactor(app-lifecycle): invert window-all-closed for clearer macOS intent --- src/main/app-lifecycle-service.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/app-lifecycle-service.ts b/src/main/app-lifecycle-service.ts index fe741783..c91729dd 100644 --- a/src/main/app-lifecycle-service.ts +++ b/src/main/app-lifecycle-service.ts @@ -44,11 +44,12 @@ export function createAppLifecycleService({ }); app.on("window-all-closed", () => { - // On macOS, keep the app running when all windows are closed (standard behavior) - // UNLESS the user explicitly chose Quit (before-quit already fired). - if (process.platform !== "darwin" || shouldQuit()) { - app.quit(); + // macOS keeps the app alive when all windows close (standard platform behavior), + // except after the user picked Quit (before-quit already fired -> shouldQuit()). + if (process.platform === "darwin" && !shouldQuit()) { + return; } + app.quit(); }); app.on("before-quit", () => {