fix(desktop): restore Linux window icons (#13120)

This commit is contained in:
KetchupZ
2026-10-26 12:09:10 +00:00
committed by GitHub
parent 4cc00edb8a
commit bdb3e64867
4 changed files with 31 additions and 1 deletions
+1
View File
@@ -1,6 +1,7 @@
{
"name": "goose-app",
"productName": "Goose",
"desktopName": "Goose.desktop",
"version": "1.56.0",
"description": "Goose App",
"engines": {
+5 -1
View File
@@ -65,6 +65,9 @@ import {
isAuthorizedFileAccessRequest,
readSelectedRecipe,
} from './desktopFileAccess';
import { getWindowIconFilename } from './utils/windowIcon';
const windowIconPath = path.join(__dirname, '../images', getWindowIconFilename(process.platform));
function shouldSetupUpdater(): boolean {
// Setup updater if either the flag is enabled OR dev updates are enabled
@@ -1253,7 +1256,7 @@ const createChat = async (
minWidth: 480,
minHeight: 400,
resizable: true,
icon: path.join(__dirname, '../images/icon.icns'),
icon: windowIconPath,
webPreferences: {
spellcheck: settings.spellcheckEnabled ?? true,
preload: path.join(__dirname, 'preload.js'),
@@ -2985,6 +2988,7 @@ async function appMain() {
height: gooseApp.height ?? 600,
resizable: gooseApp.resizable ?? true,
useContentSize: true,
icon: windowIconPath,
webPreferences: {
preload: path.join(__dirname, 'preload.js'),
nodeIntegration: false,
+16
View File
@@ -0,0 +1,16 @@
import { describe, expect, it } from 'vitest';
import { getWindowIconFilename } from './windowIcon';
describe('getWindowIconFilename', () => {
it.each([
['darwin', 'icon.icns'],
['win32', 'icon.ico'],
['linux', 'icon.png'],
] as const)('uses the native icon for %s', (platform, expected) => {
expect(getWindowIconFilename(platform)).toBe(expected);
});
it('uses the cross-platform PNG fallback', () => {
expect(getWindowIconFilename('freebsd')).toBe('icon.png');
});
});
+9
View File
@@ -0,0 +1,9 @@
export function getWindowIconFilename(platform: typeof process.platform): string {
if (platform === 'darwin') {
return 'icon.icns';
}
if (platform === 'win32') {
return 'icon.ico';
}
return 'icon.png';
}