From 6fa68632441b3be39908820de7556548dd977f7b Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 20 May 2014 22:34:37 +0800 Subject: [PATCH] Don't popup context menu with no items, fixes #2032. On OS X popuping an empty context menu would have no effect but on Linux an empty menu container would still be showed. --- src/context-menu-manager.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/src/context-menu-manager.coffee b/src/context-menu-manager.coffee index c310c9c48..908e9fc8a 100644 --- a/src/context-menu-manager.coffee +++ b/src/context-menu-manager.coffee @@ -98,5 +98,6 @@ class ContextMenuManager showForEvent: (event) -> @activeElement = event.target menuTemplate = @combinedMenuTemplateForElement(event.target) + return unless menuTemplate?.length > 0 @executeBuildHandlers(event, menuTemplate) remote.getCurrentWindow().emit('context-menu', menuTemplate)