()
| 428 | * + an `isEmpty()` check so we can surface the bad-path case in the log. |
| 429 | */ |
| 430 | const installDockIcon = () => { |
| 431 | if (process.platform !== "darwin") return; |
| 432 | if (app.isPackaged) return; |
| 433 | if (!app.dock) return; |
| 434 | const iconPath = resolveSourceIconPath(); |
| 435 | if (!existsSync(iconPath)) { |
| 436 | log.warn(`[dock-icon] file missing at ${iconPath}; skipping`); |
| 437 | return; |
| 438 | } |
| 439 | const image = nativeImage.createFromPath(iconPath); |
| 440 | if (image.isEmpty()) { |
| 441 | log.warn(`[dock-icon] failed to decode ${iconPath}; skipping`); |
| 442 | return; |
| 443 | } |
| 444 | app.dock.setIcon(image); |
| 445 | log.info(`[dock-icon] set to ${iconPath} (${image.getSize().width}×${image.getSize().height})`); |
| 446 | }; |
| 447 | |
| 448 | const createMainBrowserWindow = (options: { readonly show: boolean }): BrowserWindow => { |
| 449 | const windowState = windowStateKeeper({ |
no test coverage detected