mac: Don't emit "clicked" event if there is menu attached
This commit is contained in:
parent
aa03eb5b6c
commit
a3f3a35fd1
1 changed files with 12 additions and 9 deletions
|
@ -207,23 +207,26 @@ const CGFloat kVerticalTitleMargin = 2;
|
||||||
}
|
}
|
||||||
inMouseEventSequence_ = NO;
|
inMouseEventSequence_ = NO;
|
||||||
|
|
||||||
// Single click
|
// Show menu when single clicked on the icon.
|
||||||
if (event.clickCount == 1) {
|
if (event.clickCount == 1 && menuController_)
|
||||||
if (menuController_) {
|
[statusItem_ popUpStatusItemMenu:[menuController_ menu]];
|
||||||
[statusItem_ popUpStatusItemMenu:[menuController_ menu]];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// Don't emit click events when menu is showing.
|
||||||
|
if (menuController_)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Single click event.
|
||||||
|
if (event.clickCount == 1)
|
||||||
trayIcon_->NotifyClicked(
|
trayIcon_->NotifyClicked(
|
||||||
[self getBoundsFromEvent:event],
|
[self getBoundsFromEvent:event],
|
||||||
ui::EventFlagsFromModifiers([event modifierFlags]));
|
ui::EventFlagsFromModifiers([event modifierFlags]));
|
||||||
}
|
|
||||||
|
|
||||||
// Double click
|
// Double click event.
|
||||||
if (event.clickCount == 2 && !menuController_) {
|
if (event.clickCount == 2)
|
||||||
trayIcon_->NotifyDoubleClicked(
|
trayIcon_->NotifyDoubleClicked(
|
||||||
[self getBoundsFromEvent:event],
|
[self getBoundsFromEvent:event],
|
||||||
ui::EventFlagsFromModifiers([event modifierFlags]));
|
ui::EventFlagsFromModifiers([event modifierFlags]));
|
||||||
}
|
|
||||||
[self setNeedsDisplay:YES];
|
[self setNeedsDisplay:YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue