feat(electron-shell): 1.11.0 新增设置中心与执行超时/内存分层,组件运行状态与运行历史峰值内存
This commit is contained in:
@@ -5,6 +5,7 @@ const fs = require("fs");
|
||||
const { app, BrowserWindow, Tray, Menu, nativeImage, dialog, screen, ipcMain } = require("electron");
|
||||
const path = require("path");
|
||||
const config = require("./config");
|
||||
const settings = require("./settings");
|
||||
const { makeLogger } = require("./logger");
|
||||
const trayMenu = require("./tray-menu");
|
||||
|
||||
@@ -129,7 +130,14 @@ if (!app.requestSingleInstanceLock()) {
|
||||
if (mainWindow && !mainWindow.isDestroyed()) saveWindowState(mainWindow);
|
||||
return; // 真正退出:放行关闭
|
||||
}
|
||||
// 关闭按钮 → 收托盘(隐藏窗口,服务/插件继续运行),从托盘菜单「退出」才真正退出
|
||||
// 关闭行为由「设置 → 启动与关闭」决定:
|
||||
// tray(默认)= 收托盘,服务/插件继续跑,托盘菜单「退出」才真正退出;
|
||||
// quit = 关闭即退出,队列中任务按正常退出路径落「已取消」。
|
||||
if (settings.closeBehavior() === "quit") {
|
||||
isQuitting = true;
|
||||
if (mainWindow && !mainWindow.isDestroyed()) saveWindowState(mainWindow);
|
||||
return; // 放行关闭 → window-all-closed → app.quit()
|
||||
}
|
||||
e.preventDefault();
|
||||
mainWindow.hide();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user