From bd4a7b073afab589f039f25eb706bd3141d2d426 Mon Sep 17 00:00:00 2001 From: Jannis Braun <151788261+TheZwiss@users.noreply.github.com> Date: Mon, 27 Apr 2026 14:38:42 +0200 Subject: [PATCH] fix(desktop): rewrite tray loader with explicit per-platform branches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three branches now: macOS template (.png + @2x, auto-recolour), Windows multi-size .ico (DPI auto-pick), Linux 22x22 PNG. Drops the runtime .resize({16,16}) — pre-rendered assets are at correct platform sizes; runtime resize re-introduced bicubic blur. Defensive fallback to the programmatic blurple circle is preserved but should not trigger in practice now that templates ship populated. --- packages/desktop/src/main.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/desktop/src/main.ts b/packages/desktop/src/main.ts index 9c2d78a5..aa04ae10 100644 --- a/packages/desktop/src/main.ts +++ b/packages/desktop/src/main.ts @@ -253,12 +253,20 @@ function loadTrayIcon(): Electron.NativeImage { icon.setTemplateImage(true); return icon; } + } else if (process.platform === 'win32') { + // Windows: multi-size .ico — Windows + Electron auto-pick best size for current DPI. + const icoPath = path.join(resourcesDir, 'tray-icon.ico'); + const icon = nativeImage.createFromPath(icoPath); + if (!icon.isEmpty()) { + return icon; + } } else { - // Windows/Linux: colored icon + // Linux: single 22x22 PNG (AppIndicator / StatusNotifier convention). + // No runtime resize — the source is already at correct tray size. const iconPath = path.join(resourcesDir, 'tray-icon.png'); const icon = nativeImage.createFromPath(iconPath); if (!icon.isEmpty()) { - return icon.resize({ width: 16, height: 16 }); + return icon; } } } catch {