mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 757330 Don't activate an empty menubar r=Enn
This commit is contained in:
parent
9bf1a59717
commit
a395dd73d3
@ -150,14 +150,14 @@ nsMenuBarFrame::ToggleMenuActiveState()
|
||||
if (mCurrentMenu)
|
||||
mCurrentMenu->SelectMenu(false);
|
||||
|
||||
// Activate the menu bar
|
||||
SetActive(true);
|
||||
|
||||
// Set the active menu to be the top left item (e.g., the File menu).
|
||||
// We use an attribute called "menuactive" to track the current
|
||||
// active menu.
|
||||
nsMenuFrame* firstFrame = nsXULPopupManager::GetNextMenuItem(this, nsnull, false);
|
||||
if (firstFrame) {
|
||||
// Activate the menu bar
|
||||
SetActive(true);
|
||||
|
||||
#ifdef MOZ_WIDGET_GTK2
|
||||
firstFrame->OpenMenu(true);
|
||||
#else
|
||||
|
@ -240,11 +240,13 @@ nsMenuBarListener::KeyPress(nsIDOMEvent* aKeyEvent)
|
||||
mMenuBarFrame->SetActiveByKeyboard();
|
||||
ToggleMenuActiveState();
|
||||
|
||||
if (mMenuBarFrame->IsActive()) {
|
||||
aKeyEvent->StopPropagation();
|
||||
aKeyEvent->PreventDefault();
|
||||
return NS_OK; // consume the event
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !XP_MACOSX
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user