From 7a488fdb17f230bf4a357dce4ebf205fc4db4bd0 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Wed, 11 May 2022 15:22:52 +0200 Subject: [PATCH] fix: tray icon not highlighting on empty menu --- shell/browser/ui/tray_icon_cocoa.mm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shell/browser/ui/tray_icon_cocoa.mm b/shell/browser/ui/tray_icon_cocoa.mm index 0a37e4fea727e..789a993adb9f5 100644 --- a/shell/browser/ui/tray_icon_cocoa.mm +++ b/shell/browser/ui/tray_icon_cocoa.mm @@ -190,9 +190,9 @@ - (void)mouseDown:(NSEvent*)event { gfx::ScreenPointFromNSPoint([event locationInWindow]), ui::EventFlagsFromModifiers([event modifierFlags])); - // Pass click to superclass to show menu. Custom mouseUp handler won't be - // invoked. - if (menuController_) { + // Pass click to superclass to show menu if one exists and has a non-zero + // number of items. Custom mouseUp handler won't be invoked in this case. + if (menuController_ && [[menuController_ menu] numberOfItems] > 0) { [self handleClickNotifications:event]; [super mouseDown:event]; } else {