Browse Source

fix: tray icon not highlighting on empty menu (#34208)

Co-authored-by: Shelley Vohr <[email protected]>
trop[bot] 2 years ago
parent
commit
21b8200170
1 changed files with 3 additions and 3 deletions
  1. 3 3
      shell/browser/ui/tray_icon_cocoa.mm

+ 3 - 3
shell/browser/ui/tray_icon_cocoa.mm

@@ -190,9 +190,9 @@
       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 {