From c63ca4606aa679df15d9754c36dd832a17abdc60 Mon Sep 17 00:00:00 2001 From: Shubham Padia Date: Fri, 24 Oct 2025 16:55:28 +0530 Subject: [PATCH] tray: Do not change scaling factor for image. Fixes #1364. Changing the scaling factor of the unread image was broken on linux when the users were using fractional scaling. The icon looks all jumbled up. We default to scaleFactor 1 now, since an un-scaled icon is better than a jumbled icon. Co-authored-by: Aitchessbee --- app/renderer/js/tray.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/renderer/js/tray.ts b/app/renderer/js/tray.ts index 962739455..0943b880b 100644 --- a/app/renderer/js/tray.ts +++ b/app/renderer/js/tray.ts @@ -53,7 +53,6 @@ const trayIconSize = (): number => { // Default config for Icon we might make it OS specific if needed like the size const config = { - pixelRatio: window.devicePixelRatio, unreadCount: 0, showUnreadCount: true, unreadColor: "#000000", @@ -67,7 +66,7 @@ const config = { const renderCanvas = function (argument: number): HTMLCanvasElement { config.unreadCount = argument; - const size = config.size * config.pixelRatio; + const {size} = config; const padding = size * 0.05; const center = size / 2; const hasCount = config.showUnreadCount && config.unreadCount; @@ -127,9 +126,7 @@ const renderNativeImage = function (argument: number): NativeImage { const pngData = nativeImage .createFromDataURL(canvas.toDataURL("image/png")) .toPNG(); - return nativeImage.createFromBuffer(pngData, { - scaleFactor: config.pixelRatio, - }); + return nativeImage.createFromBuffer(pngData); }; function sendAction(