From acb64a2d3ced6760ebb3596caa9a7a5624519921 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Tue, 23 Jun 2020 08:37:13 -0700 Subject: [PATCH] fix: only notify mouse-up on mouse-up (#24240) --- shell/browser/ui/tray_icon_cocoa.mm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shell/browser/ui/tray_icon_cocoa.mm b/shell/browser/ui/tray_icon_cocoa.mm index 8c58ecd2d7c2f..c4ce738156229 100644 --- a/shell/browser/ui/tray_icon_cocoa.mm +++ b/shell/browser/ui/tray_icon_cocoa.mm @@ -131,10 +131,6 @@ - (void)setMenuController:(ElectronMenuController*)menu { } - (void)handleClickNotifications:(NSEvent*)event { - trayIcon_->NotifyMouseUp( - gfx::ScreenPointFromNSPoint([event locationInWindow]), - ui::EventFlagsFromModifiers([event modifierFlags])); - // If we are ignoring double click events, we should ignore the `clickCount` // value and immediately emit a click event. BOOL shouldBeHandledAsASingleClick = @@ -172,6 +168,10 @@ - (void)mouseDown:(NSEvent*)event { - (void)mouseUp:(NSEvent*)event { [[statusItem_ button] highlight:NO]; + trayIcon_->NotifyMouseUp( + gfx::ScreenPointFromNSPoint([event locationInWindow]), + ui::EventFlagsFromModifiers([event modifierFlags])); + [self handleClickNotifications:event]; }