Release XP menu rollup listener before menu is executed. This restores normal event handling earlier. Fixes bug 15596. r:hyatt

This commit is contained in:
danm%netscape.com 1999-10-05 23:31:06 +00:00
Родитель a89e1c3721
Коммит dbe1a08a25
3 изменённых файлов: 14 добавлений и 0 удалений

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

@ -452,6 +452,12 @@ nsMenuBarFrame::Enter()
NS_IMETHODIMP NS_IMETHODIMP
nsMenuBarFrame::HideChain() nsMenuBarFrame::HideChain()
{ {
// Stop capturing rollups
// (must do this during Hide, which happens before the menu item is executed,
// since this reinstates normal event handling.)
if (nsMenuFrame::mDismissalListener)
nsMenuFrame::mDismissalListener->Unregister();
if (mCurrentMenu) { if (mCurrentMenu) {
mCurrentMenu->ActivateMenu(PR_FALSE); mCurrentMenu->ActivateMenu(PR_FALSE);
mCurrentMenu->SelectMenu(PR_FALSE); mCurrentMenu->SelectMenu(PR_FALSE);

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

@ -109,8 +109,10 @@ nsMenuDismissalListener::Rollup()
{ {
if (mEnabled) { if (mEnabled) {
if (mMenuParent) { if (mMenuParent) {
AddRef();
mMenuParent->HideChain(); mMenuParent->HideChain();
mMenuParent->DismissChain(); mMenuParent->DismissChain();
Release();
} }
else else
Unregister(); Unregister();

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

@ -616,6 +616,12 @@ nsMenuPopupFrame::GetParentPopup(nsIMenuParent** aMenuParent)
NS_IMETHODIMP NS_IMETHODIMP
nsMenuPopupFrame::HideChain() nsMenuPopupFrame::HideChain()
{ {
// Stop capturing rollups
// (must do this during Hide, which happens before the menu item is executed,
// since this reinstates normal event handling.)
if (nsMenuFrame::mDismissalListener)
nsMenuFrame::mDismissalListener->Unregister();
nsIFrame* frame; nsIFrame* frame;
GetParent(&frame); GetParent(&frame);
if (frame) { if (frame) {