Fix Cmd+Q on macOS leaving the desktop app alive
The before-quit handler preventDefaulted on every quit and re-fired app.quit() from .finally. That re-entered Electron through the window-all-closed gate, which on macOS is a no-op listener that vetoes the quit — so the window closed but the process stayed up. Use app.exit(0) to bypass the close → window-all-closed → will-quit chain entirely. Also drop the daemon-stop NSAlert: with no parent window it ran app-modal and stalled the child-process pipes for 'paseo daemon stop', so daemon shutdown waited on the user dismissing the dialog. Replace it with an in-app overlay rendered in the renderer via a paseo:event:quitting IPC event. Stop opening DevTools on dev boot.
This commit is contained in:
@@ -9,7 +9,7 @@ import path from "node:path";
|
||||
import { pathToFileURL } from "node:url";
|
||||
import { existsSync } from "node:fs";
|
||||
import { execFileSync } from "node:child_process";
|
||||
import { app, BrowserWindow, dialog, ipcMain, nativeImage, net, protocol } from "electron";
|
||||
import { app, BrowserWindow, ipcMain, nativeImage, net, protocol } from "electron";
|
||||
import { createDaemonCommandHandlers, registerDaemonManager } from "./daemon/daemon-manager.js";
|
||||
import {
|
||||
parseCliPassthroughArgsFromArgv,
|
||||
@@ -218,7 +218,6 @@ async function createMainWindow(): Promise<void> {
|
||||
const { loadReactDevTools } = await import("./features/react-devtools.js");
|
||||
await loadReactDevTools();
|
||||
await mainWindow.loadURL(DEV_SERVER_URL);
|
||||
mainWindow.webContents.openDevTools({ mode: "detach" });
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -402,13 +401,9 @@ void bootstrap().catch((error) => {
|
||||
});
|
||||
|
||||
function showDaemonShutdownDialog(): void {
|
||||
void dialog.showMessageBox({
|
||||
type: "info",
|
||||
message: "Shutting down Paseo daemon…",
|
||||
detail: "Paseo will quit once the local daemon has stopped.",
|
||||
buttons: [],
|
||||
noLink: true,
|
||||
});
|
||||
for (const win of BrowserWindow.getAllWindows()) {
|
||||
win.webContents.send("paseo:event:quitting", {});
|
||||
}
|
||||
}
|
||||
|
||||
app.on(
|
||||
|
||||
Reference in New Issue
Block a user