fix(SelectionAssistant): JetBrains IDEs, Remote desktop, Gaming, PDF views, etc (#6809)

fix: jetbrains ides, remote desktop, pdf views, etcs
This commit is contained in:
fullex 2025-06-04 23:56:05 +08:00 committed by GitHub
parent fe038de23d
commit 7542040d5e
4 changed files with 44 additions and 13 deletions

View File

@ -92,7 +92,7 @@
"officeparser": "^4.1.1",
"os-proxy-config": "^1.1.2",
"proxy-agent": "^6.5.0",
"selection-hook": "^0.9.20",
"selection-hook": "^0.9.21",
"tar": "^7.4.3",
"turndown": "^7.2.0",
"webdav": "^5.8.0",

View File

@ -1,8 +1,13 @@
interface IBlacklist {
interface IFilterList {
WINDOWS: string[]
MAC?: string[]
}
interface IFinetunedList {
EXCLUDE_CLIPBOARD_CURSOR_DETECT: IFilterList
INCLUDE_CLIPBOARD_DELAY_READ: IFilterList
}
/*************************************************************************
*
* Note: Do not modify this configuration unless you fully understand its meaning, implications, and intended behavior.
@ -13,7 +18,7 @@ interface IBlacklist {
*
* Specification: must be all lowercase, need to accurately find the actual running program name
*************************************************************************/
export const SELECTION_PREDEFINED_BLACKLIST: IBlacklist = {
export const SELECTION_PREDEFINED_BLACKLIST: IFilterList = {
WINDOWS: [
// Screenshot
'snipaste.exe',
@ -36,6 +41,17 @@ export const SELECTION_PREDEFINED_BLACKLIST: IBlacklist = {
'maya.exe',
// CAD
'acad.exe',
'sldworks.exe'
'sldworks.exe',
// Remote Desktop
'mstsc.exe'
]
}
export const SELECTION_FINETUNED_LIST: IFinetunedList = {
EXCLUDE_CLIPBOARD_CURSOR_DETECT: {
WINDOWS: ['acrobat.exe', 'wps.exe', 'cajviewer.exe']
},
INCLUDE_CLIPBOARD_DELAY_READ: {
WINDOWS: ['acrobat.exe', 'wps.exe', 'cajviewer.exe', 'foxitphantom.exe']
}
}

View File

@ -1,4 +1,4 @@
import { SELECTION_PREDEFINED_BLACKLIST } from '@main/configs/SelectionConfig'
import { SELECTION_FINETUNED_LIST, SELECTION_PREDEFINED_BLACKLIST } from '@main/configs/SelectionConfig'
import { isDev, isWin } from '@main/constant'
import { IpcChannel } from '@shared/IpcChannel'
import { BrowserWindow, ipcMain, screen } from 'electron'
@ -157,6 +157,7 @@ export class SelectionService {
this.filterList = configManager.getSelectionAssistantFilterList()
this.setHookGlobalFilterMode(this.filterMode, this.filterList)
this.setHookFineTunedList()
configManager.subscribe(ConfigKeys.SelectionAssistantTriggerMode, (triggerMode: TriggerMode) => {
const oldTriggerMode = this.triggerMode
@ -205,9 +206,9 @@ export class SelectionService {
if (!this.selectionHook) return
const modeMap = {
default: 0,
whitelist: 1,
blacklist: 2
default: SelectionHook!.FilterMode.DEFAULT,
whitelist: SelectionHook!.FilterMode.INCLUDE_LIST,
blacklist: SelectionHook!.FilterMode.EXCLUDE_LIST
}
let combinedList: string[] = list
@ -237,6 +238,20 @@ export class SelectionService {
}
}
private setHookFineTunedList() {
if (!this.selectionHook) return
this.selectionHook.setFineTunedList(
SelectionHook!.FineTunedListType.EXCLUDE_CLIPBOARD_CURSOR_DETECT,
SELECTION_FINETUNED_LIST.EXCLUDE_CLIPBOARD_CURSOR_DETECT.WINDOWS
)
this.selectionHook.setFineTunedList(
SelectionHook!.FineTunedListType.INCLUDE_CLIPBOARD_DELAY_READ,
SELECTION_FINETUNED_LIST.INCLUDE_CLIPBOARD_DELAY_READ.WINDOWS
)
}
/**
* Start the selection service and initialize required windows
* @returns {boolean} Success status of service start

View File

@ -5667,7 +5667,7 @@ __metadata:
remark-math: "npm:^6.0.0"
rollup-plugin-visualizer: "npm:^5.12.0"
sass: "npm:^1.88.0"
selection-hook: "npm:^0.9.20"
selection-hook: "npm:^0.9.21"
shiki: "npm:^3.4.2"
string-width: "npm:^7.2.0"
styled-components: "npm:^6.1.11"
@ -16400,13 +16400,13 @@ __metadata:
languageName: node
linkType: hard
"selection-hook@npm:^0.9.20":
version: 0.9.20
resolution: "selection-hook@npm:0.9.20"
"selection-hook@npm:^0.9.21":
version: 0.9.21
resolution: "selection-hook@npm:0.9.21"
dependencies:
node-gyp: "npm:latest"
node-gyp-build: "npm:^4.8.4"
checksum: 10c0/2508fc5093a735467bd7082ae84432e2b7d8675d194f9bcf74dab755a63f72ffcbbeee2784297402fbb295faddd590b0333ca290b37047d8af25ed584cd04e60
checksum: 10c0/e458f8d37c049899e0f9450ca29f882ee01e11b15490f7ee2ddd088843e3e9a201fd5410083faebfbf11e1259a2a74b0b736ff8f1789b626a21ea48ef0ca8705
languageName: node
linkType: hard