Merge pull request #2410 from atom/pop_context_menu_issue

Check context menu when calling popContextMenu API.
This commit is contained in:
Cheng Zhao 2015-08-05 10:04:26 +08:00
commit dc60bfa885

View file

@ -162,6 +162,9 @@ void NotifyIcon::DisplayBalloon(const gfx::Image& icon,
}
void NotifyIcon::PopContextMenu(const gfx::Point& pos) {
// Returns if context menu isn't set.
if (!menu_model_)
return;
// Set our window as the foreground window, so the context menu closes when
// we click away from it.
if (!SetForegroundWindow(window_))