fix: close context menu before popup (#17474)
This commit is contained in:
parent
d2ad8efef4
commit
49f13e38f9
2 changed files with 21 additions and 0 deletions
|
@ -142,6 +142,10 @@ void NotifyIcon::PopUpContextMenu(const gfx::Point& pos,
|
|||
if (!SetForegroundWindow(window_))
|
||||
return;
|
||||
|
||||
// Cancel current menu if there is one.
|
||||
if (menu_runner_ && menu_runner_->IsRunning())
|
||||
menu_runner_->Cancel();
|
||||
|
||||
// Show menu at mouse's position by default.
|
||||
gfx::Rect rect(pos, gfx::Size());
|
||||
if (pos.IsOrigin())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue