Check context menu when calling popContextMenu API.

This commit is contained in:
Haojian Wu 2015-08-04 19:45:44 +08:00
parent 2eaaad610d
commit 613e5c77ea

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_))