Skip to content

Commit

Permalink
Windows: Reintroduce flash frame when we trigger a notification
Browse files Browse the repository at this point in the history
  • Loading branch information
scottnonnenberg-signal authored and kenpowers-signal committed Sep 6, 2019
1 parent e011589 commit 5bd9964
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions js/notifications.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* global Signal:false */
/* global Backbone: false */

/* global drawAttention: false */
/* global i18n: false */
/* global isFocused: false */
/* global Signal: false */
Expand Down Expand Up @@ -135,6 +136,8 @@
message = i18n('newMessage');
}

drawAttention();

this.lastNotification = new Notification(title, {
body: window.platform === 'linux' ? filter(message) : message,
icon: iconUrl,
Expand Down
6 changes: 6 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 4 additions & 0 deletions preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 5bd9964

Please sign in to comment.