From 74f78a918c8a7a6e7c1a93a0367aa7f0a277a562 Mon Sep 17 00:00:00 2001 From: Yuya Ochiai Date: Sun, 24 Jul 2016 22:26:28 +0900 Subject: [PATCH 1/2] Fix Windows 10 desktop notifications have black Mattermost logo Electron can't know the background color of Windows 10. So replace the icon with resources/appicon.png in override of notification.js. Close #218 --- src/browser/js/notification.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/browser/js/notification.js b/src/browser/js/notification.js index 9eb14cc6..c3a49d6f 100644 --- a/src/browser/js/notification.js +++ b/src/browser/js/notification.js @@ -1,9 +1,15 @@ const OriginalNotification = Notification; +const appIconURL = `file:///${require('electron').remote.app.getAppPath()}/resources/appicon.png`; + function override(eventHandlers) { Notification = function(title, options) { - // Notification Center shows app's icon, so there were two icons on the notification. - if (process.platform === 'darwin') { + if (process.platform === 'win32') { + // Replace with application icon. + options.icon = appIconURL; + } + else if (process.platform === 'darwin') { + // Notification Center shows app's icon, so there were two icons on the notification. delete options.icon; } this.notification = new OriginalNotification(title, options); From c85578da4f82ef9dce32cc9fb60524a5a38efef6 Mon Sep 17 00:00:00 2001 From: Yuya Ochiai Date: Sun, 24 Jul 2016 23:17:25 +0900 Subject: [PATCH 2/2] Update README.md --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 72b5ea72..37598b19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,11 @@ ### Improvements +#### Windows +- Use the application icon for desktop notifications in Windows 10. + #### Linux - - Added an option to make the taskbar icon flash on new messages +- Added an option to make the taskbar icon flash on new messages ### Bug Fixes