diff --git a/js/notifications.js b/js/notifications.js index d6b6734811..7c0fb39ae3 100644 --- a/js/notifications.js +++ b/js/notifications.js @@ -1,6 +1,7 @@ /* global Signal:false */ /* global Backbone: false */ +/* global drawAttention: false */ /* global i18n: false */ /* global isFocused: false */ /* global Signal: false */ @@ -135,6 +136,8 @@ message = i18n('newMessage'); } + drawAttention(); + this.lastNotification = new Notification(title, { body: window.platform === 'linux' ? filter(message) : message, icon: iconUrl, diff --git a/main.js b/main.js index 7061105b28..2f852d05fd 100644 --- a/main.js +++ b/main.js @@ -890,6 +890,12 @@ ipc.on('add-setup-menu-items', () => { }); }); +ipc.on('draw-attention', () => { + if (process.platform === 'win32' && mainWindow) { + mainWindow.flashFrame(true); + } +}); + ipc.on('restart', () => { app.relaunch(); app.quit(); diff --git a/preload.js b/preload.js index be832ebc64..369fb10caf 100644 --- a/preload.js +++ b/preload.js @@ -90,6 +90,10 @@ window.open = () => null; // eslint-disable-next-line no-eval, no-multi-assign window.eval = global.eval = () => null; +window.drawAttention = () => { + window.log.info('draw attention'); + ipc.send('draw-attention'); +}; window.showWindow = () => { window.log.info('show window'); ipc.send('show-window');