ELECTRON-736 (Show menu at 0,0 cord if the window is in full-screen mode) (#512)

* ELECTRON-736 - Show menu at 0,0 cord if the window is in full screen mode

* ELECTRON-736 - Fix unit registry test
This commit is contained in:
Kiran Niranjan 2018-10-29 14:25:45 +05:30 committed by Vishwas Shashidhar
parent e4b28f176d
commit bae410ebbb

View File

@ -1186,7 +1186,8 @@ function cleanUpChildWindows() {
function popupMenu() {
const focusedWindow = BrowserWindow.getFocusedWindow();
if (mainWindow && !mainWindow.isDestroyed() && isMainWindow(focusedWindow)) {
const popupOpts = { browserWin: mainWindow, x: 10, y: -20 };
const { x, y } = mainWindow.isFullScreen() ? { x: 0, y: 0 } : { x: 10, y: -20 };
const popupOpts = { browserWin: mainWindow, x, y };
getMenu().popup(popupOpts);
}
}