fix: keep macOS Dock icon consistent with bundle icon (#1166)
This commit is contained in:
@@ -596,15 +596,6 @@ if (!gotLock) {
|
|||||||
console.warn("[Main] Failed to install permission handlers:", err);
|
console.warn("[Main] Failed to install permission handlers:", err);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set dock icon on macOS
|
|
||||||
if (isMac && appIcon && app.dock?.setIcon) {
|
|
||||||
try {
|
|
||||||
app.dock.setIcon(appIcon);
|
|
||||||
} catch (err) {
|
|
||||||
console.warn("Failed to set dock icon", err);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Build and set application menu. A broken menu should not take down
|
// Build and set application menu. A broken menu should not take down
|
||||||
// the entire app — fall back to no custom menu and continue startup.
|
// the entire app — fall back to no custom menu and continue startup.
|
||||||
try {
|
try {
|
||||||
|
|||||||
17
scripts/mac-dock-icon.test.cjs
Normal file
17
scripts/mac-dock-icon.test.cjs
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
const test = require("node:test");
|
||||||
|
const assert = require("node:assert/strict");
|
||||||
|
const fs = require("node:fs");
|
||||||
|
const path = require("node:path");
|
||||||
|
|
||||||
|
test("main process leaves macOS Dock icon to the packaged app bundle", () => {
|
||||||
|
const mainProcess = fs.readFileSync(
|
||||||
|
path.join(__dirname, "../electron/main.cjs"),
|
||||||
|
"utf8",
|
||||||
|
);
|
||||||
|
|
||||||
|
assert.equal(
|
||||||
|
mainProcess.includes("app.dock.setIcon"),
|
||||||
|
false,
|
||||||
|
"Do not override the macOS Dock icon at runtime; it can render at a different size than the bundled .icns icon.",
|
||||||
|
);
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user