From 6598650932231cec66b4add4d31a70a2dd82f2e3 Mon Sep 17 00:00:00 2001 From: 17564500258 <17564500258@gitee.com> Date: Wed, 22 Apr 2026 23:29:33 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=AE=9E=E7=8E=B0windows=E4=B8=8B=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E6=A0=8F=E6=8F=92=E4=BB=B6=E5=88=86=E7=A6=BB=E7=AA=97?= =?UTF-8?q?=E5=8F=A3=E7=8B=AC=E7=AB=8B=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/core/detachedWindowManager.ts | 16 ++++++++++++++-- ztools-plugin-cli | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/main/core/detachedWindowManager.ts b/src/main/core/detachedWindowManager.ts index d1aee043..51a38c67 100644 --- a/src/main/core/detachedWindowManager.ts +++ b/src/main/core/detachedWindowManager.ts @@ -173,13 +173,25 @@ class DetachedWindowManager { // Windows 系统配置(与主窗口保持一致) else if (isWindows) { windowConfig.backgroundColor = '#00000000' // 完全透明,让 Mica 材质显示 + // 设置插件窗口独立图标 + if (options.logo) { + try { + windowConfig.icon = options.logo.startsWith('file:///') + ? options.logo.slice('file:///'.length) + : options.logo + } catch (error) { + console.warn('[DetachedWindow] 设置窗口图标失败:', error) + } + } } - const win = new BrowserWindow(windowConfig) - // Windows 11 应用窗口材质(与主窗口保持一致) if (isWindows) { this.applyWindowMaterial(win) + // 设置插件窗口ID,避免任务栏窗口合并 + win.setAppDetails({ + appId: 'ZTools.' + pluginName + }) } // 窗口直接加载标题栏 HTML diff --git a/ztools-plugin-cli b/ztools-plugin-cli index de5c3822..17dd2a3b 160000 --- a/ztools-plugin-cli +++ b/ztools-plugin-cli @@ -1 +1 @@ -Subproject commit de5c3822a53680334ce7c8b429cfd375be15f5a2 +Subproject commit 17dd2a3baea00c011b9524093cada3ce43a71ec3 From 34ac8647b6c8ec3b1cc99b340a3b5f4ab0c09956 Mon Sep 17 00:00:00 2001 From: 1284604307 <1284604307@qq.com> Date: Wed, 22 Apr 2026 23:37:07 +0800 Subject: [PATCH 2/2] Update src/main/core/detachedWindowManager.ts Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- src/main/core/detachedWindowManager.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/core/detachedWindowManager.ts b/src/main/core/detachedWindowManager.ts index 51a38c67..973e03db 100644 --- a/src/main/core/detachedWindowManager.ts +++ b/src/main/core/detachedWindowManager.ts @@ -176,8 +176,8 @@ class DetachedWindowManager { // 设置插件窗口独立图标 if (options.logo) { try { - windowConfig.icon = options.logo.startsWith('file:///') - ? options.logo.slice('file:///'.length) + windowConfig.icon = options.logo.startsWith('file:') + ? fileURLToPath(options.logo) : options.logo } catch (error) { console.warn('[DetachedWindow] 设置窗口图标失败:', error)