From a5dfd9f9b46f9d23f5606bc4fe650c85bae90517 Mon Sep 17 00:00:00 2001 From: Kiran Niranjan Date: Tue, 21 Nov 2017 11:40:04 +0530 Subject: [PATCH] Electron-209 - Activating the main window after setting the alwaysOnTop property for every window --- js/windowMgr.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/js/windowMgr.js b/js/windowMgr.js index 6d021926..36a2f1d4 100644 --- a/js/windowMgr.js +++ b/js/windowMgr.js @@ -589,14 +589,14 @@ function isAlwaysOnTop(boolean) { if (browserWins.length > 0) { browserWins.forEach(function (browser) { browser.setAlwaysOnTop(boolean); - - // An issue where changing the alwaysOnTop property - // focus the pop-out window - // Issue - Electron-209 - if (browser.winName === 'main') { - activate(browser.winName); - } }); + + // An issue where changing the alwaysOnTop property + // focus the pop-out window + // Issue - Electron-209 + if (mainWindow && mainWindow.winName) { + activate(mainWindow.winName); + } } }