diff --git a/changelog.md b/changelog.md index d315a7f..6af979b 100644 --- a/changelog.md +++ b/changelog.md @@ -9,8 +9,7 @@ - 内置 Sub-Store 不使用缓存 - 允许控制是否为 Sub-Store 使用代理 -- 允许设置内核进程优先级 -- 提高进程优先级 +- Windows 允许设置内核进程优先级 ### Bug Fixes diff --git a/src/main/core/manager.ts b/src/main/core/manager.ts index f161818..103862f 100644 --- a/src/main/core/manager.ts +++ b/src/main/core/manager.ts @@ -100,7 +100,7 @@ export async function startCore(detached = false): Promise[]> { stdio: detached ? 'ignore' : undefined } ) - if (child.pid) { + if (process.platform === 'win32' && child.pid) { os.setPriority(child.pid, os.constants.priority[mihomoCpuPriority]) } if (detached) { diff --git a/src/renderer/src/components/settings/mihomo-config.tsx b/src/renderer/src/components/settings/mihomo-config.tsx index 12bca14..7cfda65 100644 --- a/src/renderer/src/components/settings/mihomo-config.tsx +++ b/src/renderer/src/components/settings/mihomo-config.tsx @@ -8,6 +8,7 @@ import { getGistUrl, patchControledMihomoConfig, restartCore } from '@renderer/u import { MdDeleteForever } from 'react-icons/md' import { BiCopy } from 'react-icons/bi' import { IoIosHelpCircle } from 'react-icons/io' +import { platform } from '@renderer/utils/init' const MihomoConfig: React.FC = () => { const { appConfig, patchAppConfig } = useAppConfig() @@ -136,26 +137,28 @@ const MihomoConfig: React.FC = () => { 四列 - - - + {platform === 'win32' && ( + + + + )}