diff --git a/atom/browser/ui/cocoa/atom_menu_controller.mm b/atom/browser/ui/cocoa/atom_menu_controller.mm index 3286b3f56b38..518b1c0d2941 100644 --- a/atom/browser/ui/cocoa/atom_menu_controller.mm +++ b/atom/browser/ui/cocoa/atom_menu_controller.mm @@ -208,7 +208,17 @@ static base::scoped_nsobject recentDocumentsMenuSwap_; base::string16 role = model->GetRoleAt(index); atom::AtomMenuModel::ItemType type = model->GetTypeAt(index); - if (type == atom::AtomMenuModel::TYPE_SUBMENU) { + + if (role == base::ASCIIToUTF16("services")) { + base::string16 title = base::ASCIIToUTF16("Services"); + NSString* label = l10n_util::FixUpWindowsStyleLabel(title); + + [item setTarget:nil]; + [item setAction:nil]; + NSMenu* submenu = [[NSMenu alloc] initWithTitle:label]; + [item setSubmenu:submenu]; + [NSApp setServicesMenu:submenu]; + } else if (type == atom::AtomMenuModel::TYPE_SUBMENU) { // Recursively build a submenu from the sub-model at this index. [item setTarget:nil]; [item setAction:nil]; @@ -223,8 +233,6 @@ static base::scoped_nsobject recentDocumentsMenuSwap_; [NSApp setWindowsMenu:submenu]; else if (role == base::ASCIIToUTF16("help")) [NSApp setHelpMenu:submenu]; - else if (role == base::ASCIIToUTF16("services")) - [NSApp setServicesMenu:submenu]; else if (role == base::ASCIIToUTF16("recentdocuments")) [self replaceSubmenuShowingRecentDocuments:item]; } else { diff --git a/default_app/menu.js b/default_app/menu.js index 2fbe1e219a3d..062bf716afc0 100644 --- a/default_app/menu.js +++ b/default_app/menu.js @@ -123,8 +123,7 @@ const setDefaultApplicationMenu = () => { type: 'separator' }, { - role: 'services', - submenu: [] + role: 'services' }, { type: 'separator' diff --git a/docs/api/menu.md b/docs/api/menu.md index 6517836ce500..0363ffdb4950 100644 --- a/docs/api/menu.md +++ b/docs/api/menu.md @@ -210,7 +210,7 @@ if (process.platform === 'darwin') { submenu: [ { role: 'about' }, { type: 'separator' }, - { role: 'services', submenu: [] }, + { role: 'services' }, { type: 'separator' }, { role: 'hide' }, { role: 'hideothers' },