зеркало из https://github.com/mozilla/pjs.git
don't mess with embedding menus when we put up an app modal dialog. b=426011 r=smorgan sr=roc
This commit is contained in:
Родитель
2b5faa6cc3
Коммит
15deb9101c
|
@ -189,14 +189,16 @@ nsIWidget* nsCocoaUtils::GetHiddenWindowWidget()
|
||||||
void nsCocoaUtils::PrepareForNativeAppModalDialog()
|
void nsCocoaUtils::PrepareForNativeAppModalDialog()
|
||||||
{
|
{
|
||||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
||||||
|
|
||||||
// First put up the hidden window menu bar so that app menu event handling is correct.
|
// Don't do anything if this is embedding. We'll assume that if there is no hidden
|
||||||
// Not a big deal if we don't do this, the chances of the spawning window having lost
|
// window we shouldn't do anything, and that should cover the embedding case.
|
||||||
// its menu bar is small.
|
|
||||||
nsIMenuBar* hiddenWindowMenuBar = MenuHelpersX::GetHiddenWindowMenuBar();
|
nsIMenuBar* hiddenWindowMenuBar = MenuHelpersX::GetHiddenWindowMenuBar();
|
||||||
if (hiddenWindowMenuBar)
|
if (!hiddenWindowMenuBar)
|
||||||
hiddenWindowMenuBar->Paint();
|
return;
|
||||||
|
|
||||||
|
// First put up the hidden window menu bar so that app menu event handling is correct.
|
||||||
|
hiddenWindowMenuBar->Paint();
|
||||||
|
|
||||||
NSMenu* mainMenu = [NSApp mainMenu];
|
NSMenu* mainMenu = [NSApp mainMenu];
|
||||||
NS_ASSERTION([mainMenu numberOfItems] > 0, "Main menu does not have any items, something is terribly wrong!");
|
NS_ASSERTION([mainMenu numberOfItems] > 0, "Main menu does not have any items, something is terribly wrong!");
|
||||||
|
|
||||||
|
@ -224,16 +226,18 @@ void nsCocoaUtils::PrepareForNativeAppModalDialog()
|
||||||
void nsCocoaUtils::CleanUpAfterNativeAppModalDialog()
|
void nsCocoaUtils::CleanUpAfterNativeAppModalDialog()
|
||||||
{
|
{
|
||||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
||||||
|
|
||||||
|
// Don't do anything if this is embedding. We'll assume that if there is no hidden
|
||||||
|
// window we shouldn't do anything, and that should cover the embedding case.
|
||||||
|
nsIMenuBar* hiddenWindowMenuBar = MenuHelpersX::GetHiddenWindowMenuBar();
|
||||||
|
if (!hiddenWindowMenuBar)
|
||||||
|
return;
|
||||||
|
|
||||||
NSWindow* mainWindow = [NSApp mainWindow];
|
NSWindow* mainWindow = [NSApp mainWindow];
|
||||||
if (!mainWindow) {
|
if (!mainWindow)
|
||||||
nsIMenuBar* hiddenWindowMenuBar = MenuHelpersX::GetHiddenWindowMenuBar();
|
hiddenWindowMenuBar->Paint();
|
||||||
if (hiddenWindowMenuBar)
|
else
|
||||||
hiddenWindowMenuBar->Paint();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
[WindowDelegate paintMenubarForWindow:mainWindow];
|
[WindowDelegate paintMenubarForWindow:mainWindow];
|
||||||
}
|
|
||||||
|
|
||||||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче