()
| 467 | * + an `isEmpty()` check so we can surface the bad-path case in the log. |
| 468 | */ |
| 469 | const installDockIcon = () => { |
| 470 | if (process.platform !== "darwin") return; |
| 471 | if (app.isPackaged) return; |
| 472 | if (!app.dock) return; |
| 473 | const iconPath = resolveSourceIconPath(); |
| 474 | if (!existsSync(iconPath)) { |
| 475 | log.warn(`[dock-icon] file missing at ${iconPath}; skipping`); |
| 476 | return; |
| 477 | } |
| 478 | const image = nativeImage.createFromPath(iconPath); |
| 479 | if (image.isEmpty()) { |
| 480 | log.warn(`[dock-icon] failed to decode ${iconPath}; skipping`); |
| 481 | return; |
| 482 | } |
| 483 | app.dock.setIcon(image); |
| 484 | log.info(`[dock-icon] set to ${iconPath} (${image.getSize().width}×${image.getSize().height})`); |
| 485 | }; |
| 486 | |
| 487 | const createMainBrowserWindow = (options: { readonly show: boolean }): BrowserWindow => { |
| 488 | const windowState = windowStateKeeper({ |
no test coverage detected