From f278bfc12b2942e2ead6492e823ea1d1ece6057f Mon Sep 17 00:00:00 2001 From: "prompt.ac/@jeffrey" Date: Mon, 14 Sep 2026 10:06:27 -0400 Subject: [PATCH] Keep Electron in menubar mode after closing the last pane (cherry picked from commit 9e4517295685a54a8f154ed1e3b1cb925b1ca349) --- ac-electron/main.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/ac-electron/main.js b/ac-electron/main.js index 79752821ed..41542532fb 100644 --- a/ac-electron/main.js +++ b/ac-electron/main.js @@ -3352,9 +3352,8 @@ app.whenReady().then(async () => { // Create initial window(s). // Default is menubar-daemon mode for EVERY launch — no AC window pops on its - // own. The user opens pieces explicitly from the tray (or by re-activating the - // app, which fires 'activate' below). We only auto-open a window for an - // explicit intent: a slab preview host, or a file opened onto the app. + // own. The user opens pieces explicitly from the tray or File menu. We only + // auto-open for a slab preview, deep link, or file opened onto the app. // 🔗 Cold-launch via an aesthetic:// deep link (Windows/Linux pass it in argv; // macOS delivers it through the 'open-url' event instead, handled above). const coldLaunchLink = findDeepLinkArg(process.argv.slice(1)); @@ -3371,11 +3370,9 @@ app.whenReady().then(async () => { acDropHandleFile(acDropColdLaunchFile); } - app.on('activate', () => { - if (BrowserWindow.getAllWindows().length === 0) { - openAcPaneWindow(); - } - }); + // Activation alone must not create a pane: macOS can activate the app while + // the last pane closes and its dock icon disappears. Stay in menubar mode + // until an explicit open request (tray, File menu, '+', file, or deep link). // Keep dock visibility in sync with window state on macOS so the app // fades out of the dock / app-switcher whenever all windows close, and -- 2.51.2