From 54f12a115ae6dda89713238f46049af0c4838081 Mon Sep 17 00:00:00 2001 From: Flinlin <3400968477@qq.com> Date: Mon, 1 Jun 2026 00:20:35 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:windows=E4=B8=8Bcopy-path=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E5=91=BD=E4=BB=A4=E5=A2=9E=E5=8A=A0=E7=AA=97=E5=8F=A3?= =?UTF-8?q?=E7=B1=BB=E5=90=8D=E5=8C=B9=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal-plugins/system/public/plugin.json | 6 ++++-- .../src/components/search/SearchResults.vue | 3 ++- src/renderer/src/stores/commandDataStore.ts | 14 +++++++++++--- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/internal-plugins/system/public/plugin.json b/internal-plugins/system/public/plugin.json index f51c087b..3e4c15bb 100644 --- a/internal-plugins/system/public/plugin.json +++ b/internal-plugins/system/public/plugin.json @@ -90,7 +90,8 @@ "type": "window", "label": "复制路径", "match": { - "app": ["Finder.app", "explorer.exe"] + "app": ["Finder.app", "explorer.exe"], + "className": ["", "CabinetWClass"] } }, { @@ -110,7 +111,8 @@ "type": "window", "label": "在终端打开", "match": { - "app": ["Finder.app", "explorer.exe"] + "app": ["Finder.app", "explorer.exe"], + "className": ["", "CabinetWClass"] } }, { diff --git a/src/renderer/src/components/search/SearchResults.vue b/src/renderer/src/components/search/SearchResults.vue index d565b16f..ca51a6cd 100644 --- a/src/renderer/src/components/search/SearchResults.vue +++ b/src/renderer/src/components/search/SearchResults.vue @@ -168,7 +168,8 @@ const windowMatchedActions = computed(() => { // 使用 commandDataStore 的 searchWindowCommands 进行匹配 const matched = commandDataStore.searchWindowCommands({ app: currentWindow.app, - title: currentWindow.title + title: currentWindow.title, + className: currentWindow.className }) // 如果有搜索内容,在匹配的窗口指令中进一步搜索 diff --git a/src/renderer/src/stores/commandDataStore.ts b/src/renderer/src/stores/commandDataStore.ts index 09af971e..fbd07268 100644 --- a/src/renderer/src/stores/commandDataStore.ts +++ b/src/renderer/src/stores/commandDataStore.ts @@ -57,6 +57,7 @@ interface WindowCmd { match: { app?: string[] // 匹配应用名称列表(如 ["Finder.app"]) title?: string // 匹配窗口标题的正则表达式字符串 + className?: string[] } } @@ -1350,7 +1351,7 @@ export const useCommandDataStore = defineStore('commandData', () => { function matchesWindowCommand( command: Command, - windowInfo?: { app?: string; title?: string } | null + windowInfo?: { app?: string; title?: string; className?: string } | null ): boolean { if ( !windowInfo || @@ -1368,7 +1369,10 @@ export const useCommandDataStore = defineStore('commandData', () => { // 直接字符串匹配 return windowInfo.app === appPattern }) - if (appMatches) { + const classNameMatches = windowCmd.match.className?.some( + (classNamePattern) => classNamePattern === windowInfo.className + ) + if (appMatches && (!windowCmd.match.className || classNameMatches)) { return true } } @@ -1385,7 +1389,11 @@ export const useCommandDataStore = defineStore('commandData', () => { } // 搜索支持窗口的指令(根据当前激活窗口进行匹配) - function searchWindowCommands(windowInfo?: { app?: string; title?: string }): SearchResult[] { + function searchWindowCommands(windowInfo?: { + app?: string + title?: string + className?: string + }): SearchResult[] { if (!windowInfo || (!windowInfo.app && !windowInfo.title)) { return [] } From 13c6f6ae21a835430048e5d63933f1ceab6419c0 Mon Sep 17 00:00:00 2001 From: Flinlin <3400968477@qq.com> Date: Mon, 1 Jun 2026 00:41:20 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix:windows=E4=B8=8B=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=A0=8F=E6=88=90=E4=B8=BA=E5=89=8D=E5=8F=B0=E7=AA=97=E5=8F=A3?= =?UTF-8?q?=E6=97=B6,=E4=B8=8D=E5=86=8D=E8=BF=9B=E8=A1=8C=E5=BD=93?= =?UTF-8?q?=E5=89=8D=E7=AA=97=E5=8F=A3=E6=95=B0=E6=8D=AE=E7=9A=84=E5=88=87?= =?UTF-8?q?=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/managers/clipboardManager.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/managers/clipboardManager.ts b/src/main/managers/clipboardManager.ts index cabd05fc..52de6a69 100644 --- a/src/main/managers/clipboardManager.ts +++ b/src/main/managers/clipboardManager.ts @@ -155,6 +155,10 @@ class ClipboardManager { className?: string hwnd?: number }): void { + //Windows下任务栏成为前台窗口时,阻止当前窗口数据的切换 + if (data.app === 'explorer.exe' && data.className === 'Shell_TrayWnd') { + return + } // 直接使用原生数据,保留所有字段 this.currentWindow = { app: data.app, @@ -841,7 +845,7 @@ class ClipboardManager { resolve(null) }, timeoutMs) - const wrappedResolve = (content: LastCopiedContent) => { + const wrappedResolve = (content: LastCopiedContent): void => { if (timer) { clearTimeout(timer) timer = null From 92f5d6f5055ed9722ab35dd960518bcdbce1b14a Mon Sep 17 00:00:00 2001 From: Flinglin <102888256+Flinglin@users.noreply.github.com> Date: Mon, 1 Jun 2026 09:34:34 +0800 Subject: [PATCH 3/3] Update src/renderer/src/stores/commandDataStore.ts Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- src/renderer/src/stores/commandDataStore.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/src/stores/commandDataStore.ts b/src/renderer/src/stores/commandDataStore.ts index fbd07268..90f3f133 100644 --- a/src/renderer/src/stores/commandDataStore.ts +++ b/src/renderer/src/stores/commandDataStore.ts @@ -1370,7 +1370,7 @@ export const useCommandDataStore = defineStore('commandData', () => { return windowInfo.app === appPattern }) const classNameMatches = windowCmd.match.className?.some( - (classNamePattern) => classNamePattern === windowInfo.className + (classNamePattern) => classNamePattern === (windowInfo.className || '') ) if (appMatches && (!windowCmd.match.className || classNameMatches)) { return true