Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

fix(desktop): restore Multica icon + WM_CLASS on Linux (MUL-2145) (#2525)

Bohan Jiang26924dcc984e
diff --git a/apps/desktop/build/icons/128x128.png b/apps/desktop/build/icons/128x128.png
new file mode 100644
index 0000000000..ab8a39850b
Binary files /dev/null and b/apps/desktop/build/icons/128x128.png differ
diff --git a/apps/desktop/build/icons/16x16.png b/apps/desktop/build/icons/16x16.png
new file mode 100644
index 0000000000..eb4a28c749
Binary files /dev/null and b/apps/desktop/build/icons/16x16.png differ
diff --git a/apps/desktop/build/icons/24x24.png b/apps/desktop/build/icons/24x24.png
new file mode 100644
index 0000000000..628780800f
Binary files /dev/null and b/apps/desktop/build/icons/24x24.png differ
diff --git a/apps/desktop/build/icons/256x256.png b/apps/desktop/build/icons/256x256.png
new file mode 100644
index 0000000000..87631c4435
Binary files /dev/null and b/apps/desktop/build/icons/256x256.png differ
diff --git a/apps/desktop/build/icons/32x32.png b/apps/desktop/build/icons/32x32.png
new file mode 100644
index 0000000000..6232ec7c0a
Binary files /dev/null and b/apps/desktop/build/icons/32x32.png differ
diff --git a/apps/desktop/build/icons/48x48.png b/apps/desktop/build/icons/48x48.png
new file mode 100644
index 0000000000..420354116c
Binary files /dev/null and b/apps/desktop/build/icons/48x48.png differ
diff --git a/apps/desktop/build/icons/512x512.png b/apps/desktop/build/icons/512x512.png
new file mode 100644
index 0000000000..b769317427
Binary files /dev/null and b/apps/desktop/build/icons/512x512.png differ
diff --git a/apps/desktop/build/icons/64x64.png b/apps/desktop/build/icons/64x64.png
new file mode 100644
index 0000000000..03a98e09eb
Binary files /dev/null and b/apps/desktop/build/icons/64x64.png differ
diff --git a/apps/desktop/electron-builder.yml b/apps/desktop/electron-builder.yml
index cc0d8ba320..f0a0c0f565 100644
--- a/apps/desktop/electron-builder.yml
+++ b/apps/desktop/electron-builder.yml
@@ -46,20 +46,31 @@ linux:
# Yaru). Forcing `multica` makes every Linux identity slot agree and
# matches `StartupWMClass=Multica` (productName-derived).
executableName: multica
- # Pin StartupWMClass explicitly to the WM_CLASS that Electron emits on
- # X11. Electron derives WM_CLASS from `app.getName()`, which in packaged
- # builds resolves to `productName` (`Multica`). Without an explicit
- # `StartupWMClass`, electron-builder writes `productName` as the default
- # — making this declaration redundant with current settings — but
- # pinning the value here turns a silent future drift (e.g. if anyone
- # renames productName or sets app.setName at boot) into a visible diff
- # against this file. The WM_CLASS ↔ StartupWMClass match is what lets
- # GNOME associate the running window with the `.desktop` entry and
- # therefore render the right icon. The post-build verification step in
- # PR #2437 is `xprop WM_CLASS` on a real Ubuntu install.
+ # Pin StartupWMClass to the WM_CLASS Electron emits on X11. Electron
+ # derives WM_CLASS from `app.getName()`, which reads the *packaged*
+ # ASAR's `package.json` — `productName` if present, otherwise `name`.
+ # PR #2437 assumed electron-builder.yml's productName fed app.getName()
+ # directly; it does not. With our source package.json carrying only
+ # `name: "@multica/desktop"`, packaged Electron emitted
+ # `WM_CLASS=@multica/desktop`, which broke association with this entry
+ # and reproduced #2515 on Ubuntu 0.2.31. The fix lives in two places
+ # outside this file — `productName: "Multica"` on the source
+ # package.json (so the ASAR carries it) and `app.setName("Multica")`
+ # in the production branch of `src/main/index.ts` (belt-and-braces).
+ # Keep `StartupWMClass: Multica` pinned here so any future drift in
+ # those two anchors shows up as a diff against this declaration.
+ # Verification on a real Ubuntu install: `xprop WM_CLASS` on a running
+ # window prints `Multica` for both fields.
desktop:
entry:
StartupWMClass: Multica
+ # Point at pre-rendered hicolor sizes. electron-builder *can* generate
+ # 16/24/32/48/64/128/256/512 from a single build/icon.png, but the
+ # auto-generation silently shipped only the 1024×1024 source in our
+ # v0.2.31 .deb (#2515 reproduces this) — leaving GNOME's hicolor lookup
+ # with no usable size and falling back to the theme default. Shipping
+ # the sizes from source removes the toolchain dependency entirely.
+ icon: build/icons
target:
- AppImage
- deb
diff --git a/apps/desktop/package.json b/apps/desktop/package.json
index d41b6cc90f..2be7267a30 100644
--- a/apps/desktop/package.json
+++ b/apps/desktop/package.json
@@ -1,5 +1,6 @@
{
"name": "@multica/desktop",
+ "productName": "Multica",
"version": "0.1.0",
"private": true,
"description": "Multica Desktop — native desktop client for the Multica platform.",
diff --git a/apps/desktop/src/main/index.ts b/apps/desktop/src/main/index.ts
index 8c278b49bc..dc5173f63b 100644
--- a/apps/desktop/src/main/index.ts
+++ b/apps/desktop/src/main/index.ts
@@ -212,6 +212,14 @@ const DEV_APP_NAME = process.env.DESKTOP_APP_SUFFIX
if (is.dev) {
app.setName(DEV_APP_NAME);
app.setPath("userData", join(app.getPath("appData"), DEV_APP_NAME));
+} else {
+ // Pin the production app name in code. Electron's Linux WM_CLASS is set
+ // from app.getName() when the first BrowserWindow is realized; the
+ // packaged ASAR's package.json `productName` already steers app.getName()
+ // to "Multica", but anchoring it here makes WM_CLASS ↔ StartupWMClass
+ // (declared in electron-builder.yml) survive a regression in
+ // productName / the build pipeline. Must run before requestSingleInstanceLock().
+ app.setName("Multica");
}
// --- Protocol registration -----------------------------------------------