优化各项

This commit is contained in:
gyq
2024-07-15 09:46:40 +08:00
parent e00feb82ec
commit 38366601d4
7 changed files with 36 additions and 14 deletions

View File

@@ -38,7 +38,8 @@ app.whenReady().then(() => {
});
ipcMain.on("quitHandler", (_, msg) => {
app.quit();
win = null;
app.exit();
});
// 给渲染进程返回打印机列表
@@ -242,6 +243,12 @@ app.whenReady().then(() => {
}
});
}
// 阻止默认关闭
win.on("close", (e) => {
e.preventDefault();
win.webContents.send("showCloseDialog");
});
});
app.on("window-all-closed", () => {
if (process.platform !== "darwin") app.quit();