bug 128983 - F4 to dismiss selects and menulists causes beep

Now only beeps if the popup has a tag of "menu"
r=aaronl  sr=jag  a=asa
This commit is contained in:
dean_tessman%hotmail.com 2002-03-21 02:58:52 +00:00
parent efc7ae0c4e
commit 4c7cd9ffba

View File

@ -1524,10 +1524,19 @@ nsMenuPopupFrame::FindMenuWithShortcut(PRUint32 aLetter)
// didn't find a matching menu item
#ifdef XP_WIN
// behavior on Windows - this item is in a popup, beep and do nothing else
nsCOMPtr<nsISound> soundInterface = do_CreateInstance("@mozilla.org/sound;1");
if (soundInterface)
soundInterface->Beep();
// behavior on Windows - this item is in a menu popup off of the
// menu bar, so beep and do nothing else
nsCOMPtr<nsIContent> parentContent;
mContent->GetParent(*getter_AddRefs(parentContent));
if (parentContent) {
nsCOMPtr<nsIAtom> tag;
parentContent->GetTag(*getter_AddRefs(tag));
if (tag == nsXULAtoms::menu) {
nsCOMPtr<nsISound> soundInterface = do_CreateInstance("@mozilla.org/sound;1");
if (soundInterface)
soundInterface->Beep();
}
}
#endif // #ifdef XP_WIN
return nsnull;