Merge pull request #2410 from atom/pop_context_menu_issue
Check context menu when calling popContextMenu API.
This commit is contained in:
commit
dc60bfa885
1 changed files with 3 additions and 0 deletions
|
@ -162,6 +162,9 @@ void NotifyIcon::DisplayBalloon(const gfx::Image& icon,
|
||||||
}
|
}
|
||||||
|
|
||||||
void NotifyIcon::PopContextMenu(const gfx::Point& pos) {
|
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
|
// Set our window as the foreground window, so the context menu closes when
|
||||||
// we click away from it.
|
// we click away from it.
|
||||||
if (!SetForegroundWindow(window_))
|
if (!SetForegroundWindow(window_))
|
||||||
|
|
Loading…
Reference in a new issue