From 7f661ae45ca9209196ace09ed0b0a593ae5e6a7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=89=AF?= <841369634@qq.com> Date: Fri, 20 Sep 2024 12:02:43 +0800 Subject: [PATCH] =?UTF-8?q?linux=EF=BC=8C=E5=BF=AB=E6=8D=B7=E9=94=AE?= =?UTF-8?q?=E4=B8=8D=E5=85=B3=E9=97=AD=E7=AA=97=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/gui/src/background.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/gui/src/background.js b/packages/gui/src/background.js index 76a7509..6277aba 100644 --- a/packages/gui/src/background.js +++ b/packages/gui/src/background.js @@ -284,7 +284,16 @@ function initApp () { app.whenReady().then(() => { globalShortcut.unregisterAll() if (DevSidecar.api.config.get().app.showHideShortcut) { - globalShortcut.register(DevSidecar.api.config.get().app.showHideShortcut, switchWin) + globalShortcut.register(DevSidecar.api.config.get().app.showHideShortcut, () => { + if (winIsHidden) { + showWin() + } else { + // linux,快捷键不关闭窗口 + if (!isLinux()) { + hideWin() + } + } + }) } }) }