mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-06-01 11:29:25 +00:00
Mac: Re-initialize the Native Application Menu on run.
This resolves #1511.
This commit is contained in:
@@ -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]);
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user