Commit 5a0e2bc7 authored by Steven Michaud's avatar Steven Michaud Committed by Georg Koppen
Browse files

Bug 1151345 - Firefox app menu sometimes contains only "Quit" on OS X. r=spohl

parent 30a36275
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@
#include "nsCocoaFeatures.h"
#include "nsCocoaUtils.h"
#include "nsChildView.h"
#include "nsMenuBarX.h"
#include "nsToolkit.h"
#include "TextInputHandler.h"
#include "mozilla/HangMonitor.h"
@@ -647,6 +648,7 @@ nsAppShell::Run(void)
  mStarted = true;

  AddScreenWakeLockListener();
  nsMenuBarX::ResetNativeApplicationMenu();

  NS_OBJC_TRY_ABORT([NSApp run]);

+1 −0
Original line number Diff line number Diff line
@@ -127,6 +127,7 @@ public:
  void              ForceUpdateNativeMenuAt(const nsAString& indexString);
  void              ForceNativeMenuReload(); // used for testing
  static char       GetLocalizedAccelKey(const char *shortcutID);
  static void       ResetNativeApplicationMenu();

protected:
  void              ConstructNativeMenus();
+8 −0
Original line number Diff line number Diff line
@@ -498,6 +498,14 @@ char nsMenuBarX::GetLocalizedAccelKey(const char *shortcutID)
  return retval;
}

/* static */
void nsMenuBarX::ResetNativeApplicationMenu()
{
  [sApplicationMenu removeAllItems];
  [sApplicationMenu release];
  sApplicationMenu = nil;
}

// Hide the item in the menu by setting the 'hidden' attribute. Returns it in |outHiddenNode| so
// the caller can hang onto it if they so choose. It is acceptable to pass nsull
// for |outHiddenNode| if the caller doesn't care about the hidden node.