From 25a0af6ddbee0df6fb907aab3c7d9aa33ecd530c Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Sun, 4 Jun 2017 11:03:12 +0100
Subject: [PATCH] to make the windows volume mixer not explode as it can't
 resize icons.                I hate Windows.

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
 electron_app/src/tray.js | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/electron_app/src/tray.js b/electron_app/src/tray.js
index 9df1a0fb..52f29800 100644
--- a/electron_app/src/tray.js
+++ b/electron_app/src/tray.js
@@ -70,10 +70,19 @@ exports.create = function(win, config) {
         // if its not default we have to construct into nativeImage
         if (newFavicon !== config.icon_path) {
             newFavicon = nativeImage.createFromDataURL(favicons[0]);
-        }
+            trayIcon.setImage(newFavicon);
 
-        trayIcon.setImage(newFavicon);
-        win.setIcon(newFavicon);
+            if (process.platform === 'win32') {
+                newFavicon = newFavicon.resize({
+                    height: 40,
+                    width: 40,
+                });
+            }
+            win.setIcon(newFavicon);
+        } else {
+            trayIcon.setImage(newFavicon);
+            win.setIcon(newFavicon);
+        }
     });
 
     win.webContents.on('page-title-updated', function(ev, title) {