fix: only notify mouse-up on mouse-up (#24240)

This commit is contained in:
Shelley Vohr 2020-06-23 08:37:13 -07:00 committed by GitHub
parent 3853fd3e99
commit acb64a2d3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -131,10 +131,6 @@
}
- (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)mouseUp:(NSEvent*)event {
[[statusItem_ button] highlight:NO];
trayIcon_->NotifyMouseUp(
gfx::ScreenPointFromNSPoint([event locationInWindow]),
ui::EventFlagsFromModifiers([event modifierFlags]));
[self handleClickNotifications:event];
}