ELECTRON-710 - Fix Always on top: notification does not show on top (#491)

This commit is contained in:
VICTOR RAPHAEL BRAGA DE SALES MASCARENHAS 2018-09-17 07:27:38 -03:00 committed by Vishwas Shashidhar
parent 8bef28234d
commit 0507507ab8

View File

@ -422,6 +422,14 @@ function setNotificationContents(notfWindow, notfObj) {
// Display time per notification basis.
let displayTime = notfObj.displayTime ? notfObj.displayTime : config.displayTime;
let browserWindows = BrowserWindow.getAllWindows();
const mainWindow = browserWindows.find((window) => { return window.winName === 'main' });
if (mainWindow && !mainWindow.isDestroyed()) {
if (mainWindow.isAlwaysOnTop()) {
notfWindow.setAlwaysOnTop(true);
}
}
if (notfWindow.displayTimer) {
clearTimeout(notfWindow.displayTimer);
}