mirror of
https://gitcode.com/JianFeeeee/ModelRouter.git
synced 2026-09-20 08:57:57 +00:00
fix(gui): resolve GNOME taskbar icon via WM_CLASS/StartupWMClass match
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
This commit is contained in:
@ -497,6 +497,11 @@ function createWindow() {
|
|||||||
const menu = Menu.buildFromTemplate([]);
|
const menu = Menu.buildFromTemplate([]);
|
||||||
Menu.setApplicationMenu(menu);
|
Menu.setApplicationMenu(menu);
|
||||||
mainWindow = new BrowserWindow({
|
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,
|
width: 1280,
|
||||||
height: 860,
|
height: 860,
|
||||||
minWidth: 900,
|
minWidth: 900,
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
"build": {
|
"build": {
|
||||||
"appId": "com.modelrouter.gui",
|
"appId": "com.modelrouter.gui",
|
||||||
"productName": "ModelRouter",
|
"productName": "ModelRouter",
|
||||||
"linux": {
|
"linux": {
|
||||||
"target": [
|
"target": [
|
||||||
"deb",
|
"deb",
|
||||||
"rpm",
|
"rpm",
|
||||||
@ -32,6 +32,11 @@
|
|||||||
"icon": "build/icon.png",
|
"icon": "build/icon.png",
|
||||||
"maintainer": "ModelRouter",
|
"maintainer": "ModelRouter",
|
||||||
"synopsis": "ModelRouter Desktop",
|
"synopsis": "ModelRouter Desktop",
|
||||||
|
"desktop": {
|
||||||
|
"entry": {
|
||||||
|
"StartupWMClass": "modelrouter-gui"
|
||||||
|
}
|
||||||
|
},
|
||||||
"extraResources": [
|
"extraResources": [
|
||||||
{
|
{
|
||||||
"from": "bin/llmsproxy",
|
"from": "bin/llmsproxy",
|
||||||
|
|||||||
Reference in New Issue
Block a user