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:
joshmoz%gmail.com 2008-04-03 03:58:45 +00:00
Родитель 2b5faa6cc3
Коммит 15deb9101c
1 изменённых файлов: 20 добавлений и 16 удалений

Просмотреть файл

@ -190,11 +190,13 @@ void nsCocoaUtils::PrepareForNativeAppModalDialog()
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
// First put up the hidden window menu bar so that app menu event handling is correct.
// Not a big deal if we don't do this, the chances of the spawning window having lost
// its menu bar is small.
// 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)
if (!hiddenWindowMenuBar)
return;
// First put up the hidden window menu bar so that app menu event handling is correct.
hiddenWindowMenuBar->Paint();
NSMenu* mainMenu = [NSApp mainMenu];
@ -225,15 +227,17 @@ void nsCocoaUtils::CleanUpAfterNativeAppModalDialog()
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
NSWindow* mainWindow = [NSApp mainWindow];
if (!mainWindow) {
// 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)
if (!hiddenWindowMenuBar)
return;
NSWindow* mainWindow = [NSApp mainWindow];
if (!mainWindow)
hiddenWindowMenuBar->Paint();
}
else {
else
[WindowDelegate paintMenubarForWindow:mainWindow];
}
NS_OBJC_END_TRY_ABORT_BLOCK;
}