Skip to content

Commit 3f03e55

Browse files
authored
Merge pull request #438 from siriusol/master
fix issues #437
2 parents 42aec34 + 73cef15 commit 3f03e55

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main/common/registerHotKey.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ const registerHotKey = (mainWindow: BrowserWindow): void => {
9393
// mainWindow.show();
9494
});
9595

96+
globalShortcut.register('CommandOrControl+W', () => {
97+
if (mainWindow && !mainWindow.isDestroyed() && mainWindow.isFocused()) {
98+
mainWindow.hide();
99+
}
100+
});
101+
96102
// 注册自定义全局快捷键
97103
config.global.forEach((sc) => {
98104
if (!sc.key || !sc.value) return;

0 commit comments

Comments
 (0)