Remove Menu::AttachToWindow
It makes the logic more complex without any benefit
This commit is contained in:
parent
6d6e75795f
commit
47e9deeb9a
5 changed files with 35 additions and 10 deletions
|
@ -70,13 +70,10 @@ BrowserWindow::getDevToolsWebContents = ->
|
|||
wrapWebContents @_getDevToolsWebContents()
|
||||
|
||||
BrowserWindow::setMenu = (menu) ->
|
||||
if process.platform is 'darwin'
|
||||
throw new Error('BrowserWindow.setMenu is not available on OS X')
|
||||
|
||||
throw new TypeError('Invalid menu') unless menu is null or menu?.constructor?.name is 'Menu'
|
||||
|
||||
@menu = menu # Keep a reference of menu in case of GC.
|
||||
@menu.attachToWindow this
|
||||
@_setMenu menu
|
||||
|
||||
BrowserWindow.getAllWindows = ->
|
||||
windows = BrowserWindow.windows
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue