diff --git a/CHANGELOG.md b/CHANGELOG.md index 32c34576..5f8b5d7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,9 +14,6 @@ Release date: TBD - Disabled `eval()` function for security improvements. - Invalidate cache before load, to make server upgrades easy -#### Windows -- Update Mattermost icon for desktop notifications in Windows 10. - #### Linux (Beta) - Added an option to make the taskbar icon flash on new messages - Added the badge to count mentions for Unity. @@ -25,11 +22,12 @@ Release date: TBD - Added an option to toggle the red dot icon for unread messages (default is on). #### Windows +- Update Mattermost icon for desktop notifications in Windows 10. - Added an option to toogle the red dot icon for unread messages (default is on). ### Bug Fixes - +- Fixed an issue where the maximized state of the app window was lost in some cases. ## Release v1.3.0 diff --git a/src/browser/webview/mattermost.js b/src/browser/webview/mattermost.js index 92ed1043..2ea99ddc 100644 --- a/src/browser/webview/mattermost.js +++ b/src/browser/webview/mattermost.js @@ -117,10 +117,16 @@ notification.override({ if (currentWindow.isVisible()) { currentWindow.focus(); } + else if (currentWindow.isMinimized()) { + currentWindow.restore(); + } else { currentWindow.show(); } } + else if (currentWindow.isMinimized()) { + currentWindow.restore(); + } else { currentWindow.show(); } diff --git a/src/main.js b/src/main.js index b4555909..e95ed7ca 100644 --- a/src/main.js +++ b/src/main.js @@ -242,8 +242,13 @@ app.on('ready', function() { trayIcon.setToolTip(app.getName()); trayIcon.on('click', function() { - if (!mainWindow.isVisible() || mainWindow.isMinimized()) { - mainWindow.show(); + if (!mainWindow.isVisible()) { + if (mainWindow.isMinimized()) { + mainWindow.restore(); + } + else { + mainWindow.show(); + } mainWindow.focus(); if (process.platform === 'darwin') { app.dock.show(); @@ -262,7 +267,8 @@ app.on('ready', function() { }); trayIcon.on('balloon-click', function() { if (process.platform === 'win32' || process.platform === 'darwin') { - mainWindow.show(); + if (mainWindow.isMinimized()) mainWindow.restore() + else mainWindow.show(); } if (process.platform === 'darwin') { diff --git a/src/main/menus/tray.js b/src/main/menus/tray.js index 4e0b5fa3..33bf80e0 100644 --- a/src/main/menus/tray.js +++ b/src/main/menus/tray.js @@ -13,7 +13,12 @@ function createTemplate(mainWindow, config) { label: team.name, accelerator: `CmdOrCtrl+${i + 1}`, click: (item, focusedWindow) => { - mainWindow.show(); // for OS X + if (mainWindow.isMinimized()) { + mainWindow.restore(); + } + else { + mainWindow.show(); + } mainWindow.webContents.send('switch-tab', i); if (process.platform === 'darwin') {