From c52e85b984bffc78125aff744513bc5d33ad72b3 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Tue, 25 Aug 2026 13:05:18 +0200 Subject: feat(client): add app icon based on the MeshBay logo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds build/icon.png (1024x1024, cropped/upscaled from QE/meshbay-logo-v2.jpg) at electron-builder's default buildResources path, so packaged .deb/.rpm builds get a real icon instead of Electron's stock one. The generic `build/` gitignore rule (Python artifacts) was swallowing this legitimate source directory, so it gets an explicit exception. BrowserWindow now points at the same file for its own icon, and the process runs with --class=MeshBay so a dev run's WM_CLASS matches the StartupWMClass electron-builder derives from productName for the packaged app — kept consistent, even though the launcher/dash icon match itself only resolves once a .desktop file exists (i.e. after packaging, not in dev). --- packages/meshbay-client/build/icon.png | Bin 0 -> 404424 bytes packages/meshbay-client/src/main.js | 11 +++++++++++ 2 files changed, 11 insertions(+) create mode 100644 packages/meshbay-client/build/icon.png (limited to 'packages/meshbay-client') diff --git a/packages/meshbay-client/build/icon.png b/packages/meshbay-client/build/icon.png new file mode 100644 index 0000000..6202459 Binary files /dev/null and b/packages/meshbay-client/build/icon.png differ diff --git a/packages/meshbay-client/src/main.js b/packages/meshbay-client/src/main.js index 0517eba..91fc4fa 100644 --- a/packages/meshbay-client/src/main.js +++ b/packages/meshbay-client/src/main.js @@ -30,6 +30,16 @@ const os = require('node:os'); const path = require('node:path'); const { pathToFileURL } = require('node:url'); +// Linux window managers/desktop shells (GNOME's dash included) group and +// icon-match a running window by its WM_CLASS, resolved against an installed +// .desktop file's StartupWMClass — not against BrowserWindow's `icon` option, +// which only sets the window's own icon (titlebar/alt-tab). Unpackaged, the +// class defaults to "electron" and nothing matches it, so the shell falls +// back to the generic Electron icon. A packaged build gets a correct +// StartupWMClass from electron-builder automatically; this switch keeps dev +// runs (`electron .`) consistent with it. +app.commandLine.appendSwitch('class', 'MeshBay'); + const UI_DIR = path.join(__dirname, '..', 'ui'); const SCHEME = 'app'; @@ -280,6 +290,7 @@ function createWindow() { ...bounds, minWidth: 320, show: false, + icon: path.join(__dirname, '..', 'build', 'icon.png'), webPreferences: { // The three that matter. `sandbox` keeps the Chromium renderer sandbox — // the strongest one available, and the reason Electron is not the -- cgit v1.2.3