diff --git a/apps/desktop/src/main/app-icon.ts b/apps/desktop/src/main/app-icon.ts index 227875601da..bb100ec4e3a 100644 --- a/apps/desktop/src/main/app-icon.ts +++ b/apps/desktop/src/main/app-icon.ts @@ -45,3 +45,9 @@ export function applyDockIcon( // Dock updates are cosmetic and must not block startup or settings writes. } } + +export function restoreDockIconAfterShow(): void { + // macOS can rebuild the tile with the bundle icon while this process keeps running. + appliedIconPath = null; + applyDockIcon(); +} diff --git a/apps/desktop/src/main/appPresence.ts b/apps/desktop/src/main/appPresence.ts index e86b217cdbb..dda2358a5ad 100644 --- a/apps/desktop/src/main/appPresence.ts +++ b/apps/desktop/src/main/appPresence.ts @@ -1,5 +1,6 @@ import { app, BrowserWindow } from 'electron'; +import { restoreDockIconAfterShow } from './app-icon.js'; import { createLogger } from './logger.js'; const log = createLogger('app-presence'); @@ -37,6 +38,7 @@ export async function ensureMainAppPresence( // actually fallen out of the Dock. app.setActivationPolicy('regular'); await app.dock?.show(); + restoreDockIconAfterShow(); return; } diff --git a/apps/desktop/src/main/remote-desktop/__tests__/captureBoundary.test.ts b/apps/desktop/src/main/remote-desktop/__tests__/captureBoundary.test.ts index 477b4849fa2..21976b303f5 100644 --- a/apps/desktop/src/main/remote-desktop/__tests__/captureBoundary.test.ts +++ b/apps/desktop/src/main/remote-desktop/__tests__/captureBoundary.test.ts @@ -10,6 +10,9 @@ vi.hoisted(() => { vi.stubGlobal('process', { ...process, platform: 'darwin', getSystemVersion: () => '26.0' }); }); +// The simulated platform is for capture behavior. Dock artwork loads native sharp. +vi.mock('../../app-icon.js', () => ({ restoreDockIconAfterShow: vi.fn() })); + const h = vi.hoisted(() => ({ wayland: false, hyprland: false, diff --git a/apps/desktop/src/main/voice-input/__tests__/globalShortcut.test.ts b/apps/desktop/src/main/voice-input/__tests__/globalShortcut.test.ts index cc06d558699..ae89d1e04a4 100644 --- a/apps/desktop/src/main/voice-input/__tests__/globalShortcut.test.ts +++ b/apps/desktop/src/main/voice-input/__tests__/globalShortcut.test.ts @@ -5,6 +5,9 @@ import type { BrowserWindow } from 'electron'; import type { VoiceInputShortcut } from '../../../shared/voiceInputData.js'; import type { GlobalVoiceInputIpcDeps } from '../global.js'; +// Shortcut tests switch process.platform independently of the native sharp binary. +vi.mock('../../app-icon.js', () => ({ restoreDockIconAfterShow: vi.fn() })); + const mocks = vi.hoisted(() => { const handlers = new Map unknown>(); const registeredShortcuts = new Map void>();