Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions apps/desktop/src/main/app-icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
2 changes: 2 additions & 0 deletions apps/desktop/src/main/appPresence.ts
Original file line number Diff line number Diff line change
@@ -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');
Expand Down Expand Up @@ -37,6 +38,7 @@ export async function ensureMainAppPresence(
// actually fallen out of the Dock.
app.setActivationPolicy('regular');
await app.dock?.show();
restoreDockIconAfterShow();
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, (...args: unknown[]) => unknown>();
const registeredShortcuts = new Map<string, () => void>();
Expand Down
Loading