fix: Linux 开发模式任务栏图标与 VS Code 归为一组

开发模式下 electron 进程 WM_CLASS 默认为 "Electron",导致桌面环境
将其与其他 Electron 应用(如 VS Code)归为一组并使用其图标。
在 app.whenReady 前调用 app.setName('JRedisDesktop') 修正 WM_CLASS。
This commit is contained in:
2026-07-11 01:00:29 +08:00
parent d804e377a3
commit 56e0b05b6b
+4
View File
@@ -6,6 +6,10 @@ import { initUpdater } from './updater'
let mainWindow: BrowserWindow | null = null 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 { function getIconPath(): string {
return join(__dirname, '../../build/icons/icon_256.png') return join(__dirname, '../../build/icons/icon_256.png')
} }