From 5a6af529899315f66cbc3742e8e57820be93bada Mon Sep 17 00:00:00 2001 From: ShadyThGod Date: Wed, 10 Oct 2018 22:25:23 +0530 Subject: [PATCH] Implement macOS dock support --- src/main.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main.js b/src/main.js index 11c75d65..3600d69a 100644 --- a/src/main.js +++ b/src/main.js @@ -129,7 +129,6 @@ app.on('ready', function() { function setTray() { //Tray icon var trayIconPath = path.join(__dirname, 'img/icon.png'); - trayIcon = new Tray(trayIconPath); const trayContextMenu = Menu.buildFromTemplate([{ label: 'Maximize', click() { @@ -159,8 +158,13 @@ app.on('ready', function() { }); } }]); - trayIcon.setToolTip('Altus'); - trayIcon.setContextMenu(trayContextMenu); + if (process.platform !== "darwin") { + trayIcon = new Tray(trayIconPath); + trayIcon.setToolTip('Altus'); + trayIcon.setContextMenu(trayContextMenu); + } else { + app.dock.setMenu(trayContextMenu); + } } function setTheme() {