Open Bug 630839 Opened 15 years ago Updated 3 months ago

Mac menus flash for removed menu items

Categories

(Core :: Widget: Cocoa, defect)

x86
macOS
defect

Tracking

()

People

(Reporter: asaf, Assigned: jaas)

References

Details

On mac, when a keyboard shortcut is activated, we flash the menu which has that keyboard shortcut set on one of its item, if any. For example, we flash the File Menu, when Cmd+W is activated. This is all fine, but there's a bug in the way: if File > Close was removed, usually by a script, the File menu would still flash when Cmd+W is activated. Once the user opens the file menu, the menu is rebuilt (in a strong-enough way... nsIStandaloneNativeMenu.menuWillOpen doesn't do the trick, another report is on the way), and activating Cmd+W will no longer highlight the File menu.
This blocks polish for bug 580638 (very visible polish, unfortunately). As bug 630840 might be invalid / wontfix, we should consider getting this fixed for Fx4.
Blocks: 580638
Neil's fix for bug 630830 may satisfy the requirement for bug 580638.
Severity: normal → S3
Assignee: nobody → jaas

This is easily reproducible by using the following command in the browser console to remove the Close Tab menu item:

document.getElementById("menu_close")?.remove();

After you do this the menu will continue to flash for cmd-w until you open it.

This happens because the native menu is lazily rebuilt upon opening. Prior to that the native menu doesn't reflect DOM changes made since the last time it was opened.

I don't think it's worth switching from lazy rebuilds just for this bug, but there might be a way to rebuild prior to keyboard shortcut activation.

You need to log in before you can comment on or make changes to this bug.