From cd35430d0ec4211938b9f3c8683fc65f45f15e76 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 25 May 2014 15:42:23 +0800 Subject: [PATCH] mac: Make sure menuWillShow is called when setting application menu. --- atom/browser/api/lib/menu.coffee | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/atom/browser/api/lib/menu.coffee b/atom/browser/api/lib/menu.coffee index acc6324d986e..0cf894ce4b35 100644 --- a/atom/browser/api/lib/menu.coffee +++ b/atom/browser/api/lib/menu.coffee @@ -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()