Skip to content

Commit

Permalink
fix: only notify mouse-up on mouse-up (#24240)
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Jun 23, 2020
1 parent 3853fd3 commit acb64a2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions shell/browser/ui/tray_icon_cocoa.mm
Expand Up @@ -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 =
Expand Down Expand Up @@ -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];
}

Expand Down

0 comments on commit acb64a2

Please sign in to comment.