Skip to content

[Bug]: App requires two close actions to quit on macOS #508

@broediger

Description

@broediger

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.tswindow-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:

  1. Quit on window close — call app.quit() on macOS too in the window-all-closed handler (simplest, but breaks macOS convention)
  2. 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)

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Status

Ready for QA

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions