Make BrowserWindow inheirt TopLevelWindow in JS
This commit is contained in:
parent
71ebd99dfa
commit
e38f511737
3 changed files with 18 additions and 12 deletions
|
@ -1,9 +1,20 @@
|
|||
'use strict'
|
||||
|
||||
const electron = require('electron')
|
||||
const {EventEmitter} = require('events')
|
||||
const {TopLevelWindow} = process.atomBinding('top_level_window')
|
||||
const v8Util = process.atomBinding('v8_util')
|
||||
|
||||
Object.setPrototypeOf(TopLevelWindow.prototype, EventEmitter.prototype)
|
||||
|
||||
TopLevelWindow.prototype._init = function () {
|
||||
// Avoid recursive require.
|
||||
const {app} = electron
|
||||
|
||||
// Simulate the application menu on platforms other than macOS.
|
||||
if (process.platform !== 'darwin') {
|
||||
const menu = app.getApplicationMenu()
|
||||
if (menu) this.setMenu(menu)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = TopLevelWindow
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue