Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: only notify mouse-up on mouse-up #24259

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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