mirror of https://github.com/vector-im/riot-web
Merge pull request #4128 from vector-im/t3chguy/electron_flash
electron flashFrame was way too annoyingrelease-v0.10.0-rc.1
commit
d988eb58c1
|
@ -119,20 +119,20 @@ electron.ipcMain.on('install_update', installUpdate);
|
||||||
let focusHandlerAttached = false;
|
let focusHandlerAttached = false;
|
||||||
electron.ipcMain.on('setBadgeCount', function(ev, count) {
|
electron.ipcMain.on('setBadgeCount', function(ev, count) {
|
||||||
electron.app.setBadgeCount(count);
|
electron.app.setBadgeCount(count);
|
||||||
if (process.platform === 'win32' && mainWindow && !mainWindow.isFocused()) {
|
if (count === 0) {
|
||||||
if (count > 0) {
|
mainWindow.flashFrame(false);
|
||||||
if (!focusHandlerAttached) {
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
electron.ipcMain.on('loudNotification', function() {
|
||||||
|
if (process.platform === 'win32' && mainWindow && !mainWindow.isFocused() && !focusHandlerAttached) {
|
||||||
|
mainWindow.flashFrame(true);
|
||||||
mainWindow.once('focus', () => {
|
mainWindow.once('focus', () => {
|
||||||
mainWindow.flashFrame(false);
|
mainWindow.flashFrame(false);
|
||||||
focusHandlerAttached = false;
|
focusHandlerAttached = false;
|
||||||
});
|
});
|
||||||
focusHandlerAttached = true;
|
focusHandlerAttached = true;
|
||||||
}
|
}
|
||||||
mainWindow.flashFrame(true);
|
|
||||||
} else {
|
|
||||||
mainWindow.flashFrame(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
let powerSaveBlockerId;
|
let powerSaveBlockerId;
|
||||||
|
|
|
@ -124,6 +124,10 @@ export default class ElectronPlatform extends VectorBasePlatform {
|
||||||
return notification;
|
return notification;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
loudNotification(ev: Event, room: Object) {
|
||||||
|
ipcRenderer.send('loudNotification');
|
||||||
|
}
|
||||||
|
|
||||||
clearNotification(notif: Notification) {
|
clearNotification(notif: Notification) {
|
||||||
notif.close();
|
notif.close();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue