From f20d0a075710706eb4254a559163778695be064b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=89=AF?= <841369634@qq.com> Date: Mon, 10 Feb 2025 19:58:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E8=B0=83=E6=95=B4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/gui/src/background.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/gui/src/background.js b/packages/gui/src/background.js index 494cc34..d12706e 100644 --- a/packages/gui/src/background.js +++ b/packages/gui/src/background.js @@ -170,7 +170,7 @@ function checkHideWin () { return true } -function hideWin (reason = '', needCheck = true) { +function hideWin (reason = '', needCheck = false) { if (win) { if (needCheck && !checkHideWin()) { return @@ -255,7 +255,7 @@ function createWindow (startHideWindow, autoQuitIfError = true) { } if (startHideWindow) { - hideWin('startHideWindow', false) + hideWin('startHideWindow') } win.on('closed', async (...args) => { @@ -268,7 +268,7 @@ function createWindow (startHideWindow, autoQuitIfError = true) { if (message.value === 1) { quit('ipc receive "close"') } else { - hideWin('ipc receive "close"') + hideWin('ipc receive "close"', true) } }) @@ -285,7 +285,7 @@ function createWindow (startHideWindow, autoQuitIfError = true) { quit('win close') } else if (closeStrategy === 2) { // 隐藏窗口 - hideWin('win close') + hideWin('win close', true) } else { // 弹窗提示,选择关闭策略 win.webContents.send('close.showTip', { closeStrategy, showHideShortcut: config.app.showHideShortcut }) @@ -381,7 +381,7 @@ function registerShowHideShortcut (showHideShortcut) { if (!win.isFocused()) { win.focus() // 如果窗口打开着,但没有获取焦点,则获取焦点,而不是hide } else { - hideWin('shortcut', false) // 快捷键隐藏窗口,不需要提示 + hideWin('shortcut') } } })