From 23bd9e5552ca1e831d963c0b1de8861371d4c51d Mon Sep 17 00:00:00 2001 From: jianf <2198972886@qq.com> Date: Mon, 17 Aug 2026 10:33:10 +0800 Subject: [PATCH] fix(gui): resolve GNOME taskbar icon via WM_CLASS/StartupWMClass match MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Window/taskbar icon never showed because the packaged .desktop had StartupWMClass=ModelRouter while the live window WM_CLASS is the lowercase app class 'modelrouter-gui' — no match, so GNOME fell back to the default Electron icon. - main.js: set BrowserWindow icon asset + backgroundColor (window paints correctly with frameless titlebar and provides the taskbar's default icon) - package.json: build.linux.desktop.entry.StartupWMClass now equals the real WM_CLASS so packaged installs match too - local integration: user-level .desktop installed at ~/.local/share/applications/modelrouter-gui.desktop (points at the unpacked binary) so GNOME resolves the icon immediately --- cmd/gui/main.js | 5 +++++ cmd/gui/package.json | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/cmd/gui/main.js b/cmd/gui/main.js index e4c09cb..833a391 100644 --- a/cmd/gui/main.js +++ b/cmd/gui/main.js @@ -497,6 +497,11 @@ function createWindow() { const menu = Menu.buildFromTemplate([]); Menu.setApplicationMenu(menu); mainWindow = new BrowserWindow({ + // Window icon (taskbar/dock): same asset as the tray and package. + icon: path.join(__dirname, "build", "icon.png"), + // GNOME taskbar icons match the window's WM_CLASS (lowercase + // "modelrouter-gui") against StartupWMClass in the .desktop file. + backgroundColor: "#1f2937", width: 1280, height: 860, minWidth: 900, diff --git a/cmd/gui/package.json b/cmd/gui/package.json index 68afe84..4f34019 100644 --- a/cmd/gui/package.json +++ b/cmd/gui/package.json @@ -22,7 +22,7 @@ "build": { "appId": "com.modelrouter.gui", "productName": "ModelRouter", - "linux": { +"linux": { "target": [ "deb", "rpm", @@ -32,6 +32,11 @@ "icon": "build/icon.png", "maintainer": "ModelRouter", "synopsis": "ModelRouter Desktop", +"desktop": { + "entry": { + "StartupWMClass": "modelrouter-gui" + } + }, "extraResources": [ { "from": "bin/llmsproxy",