Merge pull request #71 from woojufon/patch-5

自定义 CommandOrControl+W,关闭窗口会导致错误
This commit is contained in:
木偶 2021-11-22 15:09:01 +08:00 committed by GitHub
commit 8fb01cd158
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -58,6 +58,15 @@ class initApp {
} else {
readyFunction()
}
// 自定义 CommandOrControl+W关闭窗口会导致错误
app.on("browser-window-focus", function () {
globalShortcut.register("CommandOrControl+W", () => {
const win = main.getWindow();
if(win.isVisible()){
win.hide();
}
});
});
}
onRunning() {