From 56e0b05b6b02b7bf677baafcb447a04ac84ab5e1 Mon Sep 17 00:00:00 2001 From: Jokul Date: Sat, 11 Jul 2026 01:00:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Linux=20=E5=BC=80=E5=8F=91=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E4=BB=BB=E5=8A=A1=E6=A0=8F=E5=9B=BE=E6=A0=87=E4=B8=8E?= =?UTF-8?q?=20VS=20Code=20=E5=BD=92=E4=B8=BA=E4=B8=80=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 开发模式下 electron 进程 WM_CLASS 默认为 "Electron",导致桌面环境 将其与其他 Electron 应用(如 VS Code)归为一组并使用其图标。 在 app.whenReady 前调用 app.setName('JRedisDesktop') 修正 WM_CLASS。 --- src/main/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/index.ts b/src/main/index.ts index 7aa5a91..259e6a2 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -6,6 +6,10 @@ import { initUpdater } from './updater' let mainWindow: BrowserWindow | null = null +// Set app name early so Linux WM_CLASS is "JRedisDesktop" (not "Electron"), +// preventing the taskbar from grouping us with other Electron apps like VS Code. +app.setName('JRedisDesktop') + function getIconPath(): string { return join(__dirname, '../../build/icons/icon_256.png') }