Skip to content

Commit

Permalink
fix: crash when tray popup called twice (electron#18999)
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere authored Jun 28, 2019
1 parent e44bb84 commit a4f6156
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions shell/browser/ui/tray_icon_cocoa.mm
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,6 @@ - (void)popUpContextMenu:(electron::AtomMenuModel*)menu_model {
// Make sure events can be pumped while the menu is up.
base::MessageLoopCurrent::ScopedNestableTaskAllower allow;

// Ensure the UI can update while the menu is fading out.
base::ScopedPumpMessagesInPrivateModes pump_private;

// Show a custom menu.
if (menu_model) {
base::scoped_nsobject<AtomMenuController> menuController(
Expand All @@ -358,6 +355,9 @@ - (void)popUpContextMenu:(electron::AtomMenuModel*)menu_model {
}

if (menuController_ && ![menuController_ isMenuOpen]) {
// Ensure the UI can update while the menu is fading out.
base::ScopedPumpMessagesInPrivateModes pump_private;

// Redraw the tray icon to show highlight if it is enabled.
[self setNeedsDisplay:YES];

Expand Down

0 comments on commit a4f6156

Please sign in to comment.