summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore6
-rw-r--r--packages/meshbay-client/build/icon.pngbin0 -> 404424 bytes
-rw-r--r--packages/meshbay-client/src/main.js11
3 files changed, 17 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index b22c619..52897da 100644
--- a/.gitignore
+++ b/.gitignore
@@ -59,3 +59,9 @@ poc/bob_state.json
poc/testfile.bin
packages/meshbay-client/ui/
packages/meshbay-client/node_modules/
+
+# electron-builder's buildResources dir — a real source (app icon), not a
+# build artifact, despite living under a path the generic `build/` rule above
+# would otherwise swallow.
+!packages/meshbay-client/build/
+!packages/meshbay-client/build/**
diff --git a/packages/meshbay-client/build/icon.png b/packages/meshbay-client/build/icon.png
new file mode 100644
index 0000000..6202459
--- /dev/null
+++ b/packages/meshbay-client/build/icon.png
Binary files 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