From 8a30ac18fc265bd9715ca2f225a1cbda56778e5a Mon Sep 17 00:00:00 2001 From: R Midhun Suresh Date: Thu, 5 Feb 2026 18:55:12 +0530 Subject: [PATCH] Remove unncessary check --- src/electron-main.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/electron-main.ts b/src/electron-main.ts index be79d233..66b1545b 100644 --- a/src/electron-main.ts +++ b/src/electron-main.ts @@ -517,19 +517,17 @@ app.on("ready", async () => { event.preventDefault(); // Check if the user expects us to minimize to tray instead of quitting the app - const shouldMinimize = store.get("minimizeToTray") && (tray.hasTray() || process.platform === "darwin"); + // Two cases: + // 1. On Linux/Windows, user has enabled "Show tray icon and minimise window to it on close" in settings. + // 2. On Mac, the canonical behaviour is to minimize to tray; this is not configurable. + const shouldMinimize = store.get("minimizeToTray") || process.platform === "darwin"; if (shouldMinimize) { - // On Mac, closing the window just hides it - // (this is generally how single-window Mac apps - // behave, eg. Mail.app) - if (global.mainWindow?.isFullScreen()) { global.mainWindow.once("leave-full-screen", () => global.mainWindow?.hide()); global.mainWindow.setFullScreen(false); } else { global.mainWindow?.hide(); } - return; }