mac: Make sure menuWillShow is called when setting application menu.
This commit is contained in:
		
					parent
					
						
							
								6a48568911
							
						
					
				
			
			
				commit
				
					
						cd35430d0e
					
				
			
		
					 1 changed files with 6 additions and 0 deletions
				
			
		|  | @ -97,6 +97,12 @@ Menu.setApplicationMenu = (menu) -> | |||
|   applicationMenu = menu  # Keep a reference. | ||||
| 
 | ||||
|   if process.platform is 'darwin' | ||||
|     # Force menuWillShow to be called | ||||
|     menuWillShow = (menu) -> | ||||
|       menu.delegate.menuWillShow() | ||||
|       menuWillShow item.submenu for item in menu.items when item.submenu? | ||||
|     menuWillShow menu | ||||
| 
 | ||||
|     bindings.setApplicationMenu menu | ||||
|   else | ||||
|     windows = BrowserWindow.getAllWindows() | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Cheng Zhao
				Cheng Zhao