Commit ad9e764f authored by abicur's avatar abicur
Browse files

[fix] Add blur on main window close and remove unnecessary condition in "Show on unread"

parent 145eda6a
...@@ -41,6 +41,8 @@ const attachWindowStateHandling = (mainWindow) => { ...@@ -41,6 +41,8 @@ const attachWindowStateHandling = (mainWindow) => {
}); });
const close = () => { const close = () => {
mainWindow.blur();
if (process.platform === 'darwin' || state.hideOnClose) { if (process.platform === 'darwin' || state.hideOnClose) {
mainWindow.hide(); mainWindow.hide();
} else if (process.platform === 'win32') { } else if (process.platform === 'win32') {
......
...@@ -173,8 +173,7 @@ export default () => { ...@@ -173,8 +173,7 @@ export default () => {
webview.on('ipc-message-unread-changed', (hostUrl, [count]) => { webview.on('ipc-message-unread-changed', (hostUrl, [count]) => {
if (typeof count === 'number' && localStorage.getItem('showWindowOnUnreadChanged') === 'true') { if (typeof count === 'number' && localStorage.getItem('showWindowOnUnreadChanged') === 'true') {
const mainWindow = remote.getCurrentWindow(); const mainWindow = remote.getCurrentWindow();
const isNeededToShow = !mainWindow.isFocused() || (mainWindow.isFocused() && !mainWindow.isVisible()); if (!mainWindow.isFocused()) {
if (isNeededToShow) {
mainWindow.once('focus', () => mainWindow.flashFrame(false)); mainWindow.once('focus', () => mainWindow.flashFrame(false));
mainWindow.showInactive(); mainWindow.showInactive();
mainWindow.flashFrame(true); mainWindow.flashFrame(true);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment