Description
On macOS, clicking the close button (or pressing Cmd+W) only hides the main window — the app stays running in the Dock. The user must then either Cmd+Q or click the Dock icon and close again to fully quit. This feels like the app requires "closing twice".
Root Cause
In the window-all-closed handler, app.quit() is intentionally skipped on macOS (process.platform === "darwin"). This follows the standard macOS convention where apps remain active in the Dock after their window is closed.
However, since Power Platform ToolBox doesn't have a tray icon, background tasks, or other reasons to stay running without a window, the standard convention may not be the best UX here. Users expect the app to quit when they close the window.
Relevant Code
src/main/index.ts — window-all-closed handler skips app.quit() on darwin
src/main/managers/loadingOverlayWindowManager.ts — overlay window's close handler calls event.preventDefault() unless isMainWindowClosing is set, which could contribute to timing issues
Suggested Fix
Either:
- Quit on window close — call
app.quit() on macOS too in the window-all-closed handler (simplest, but breaks macOS convention)
- Quit on close, re-create on activate — quit when the window closes, but re-create the window on
activate event (Dock click) — this is what many Electron apps do when there's no reason to stay running
Environment
- OS: macOS 15 (Sequoia)
- PPTB: v1.2.1 (dev branch)
Description
On macOS, clicking the close button (or pressing Cmd+W) only hides the main window — the app stays running in the Dock. The user must then either Cmd+Q or click the Dock icon and close again to fully quit. This feels like the app requires "closing twice".
Root Cause
In the
window-all-closedhandler,app.quit()is intentionally skipped on macOS (process.platform === "darwin"). This follows the standard macOS convention where apps remain active in the Dock after their window is closed.However, since Power Platform ToolBox doesn't have a tray icon, background tasks, or other reasons to stay running without a window, the standard convention may not be the best UX here. Users expect the app to quit when they close the window.
Relevant Code
src/main/index.ts—window-all-closedhandler skipsapp.quit()on darwinsrc/main/managers/loadingOverlayWindowManager.ts— overlay window'sclosehandler callsevent.preventDefault()unlessisMainWindowClosingis set, which could contribute to timing issuesSuggested Fix
Either:
app.quit()on macOS too in thewindow-all-closedhandler (simplest, but breaks macOS convention)activateevent (Dock click) — this is what many Electron apps do when there's no reason to stay runningEnvironment