update a few menu.popup() calls to use the new API

This commit is contained in:
Charles Kerr 2018-02-20 14:02:24 -06:00
parent 35e90f742b
commit 708f39a1a5
3 changed files with 9 additions and 4 deletions

View file

@ -293,7 +293,12 @@ WebContents.prototype._init = function () {
this.on('pepper-context-menu', function (event, params, callback) {
// Access Menu via electron.Menu to prevent circular require.
const menu = electron.Menu.buildFromTemplate(params.menu)
menu.popup(event.sender.getOwnerBrowserWindow(), params.x, params.y, callback)
menu.popup({
window: event.sender.getOwnerBrowserWindow(),
x: params.x,
y: params.y,
callback: callback
})
})
// The devtools requests the webContents to reload.