优化各项
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user