Files
tubestation/widget/cocoa
spohlMozilla 2a3c838e24 Bug 1980815: Ensure that the emoji picker menu item doesn't disappear from the menu bar and that its associated shortcuts continue to work on macOS. r=mac-reviewers,bradwerth a=pascalc
This is somewhat unfortunate, but I couldn't find a better way to address this. There are two aspects to this fix:

1. In order for SVG chicklets to appear in the context menu the first time it is opened, we have to set an nsMenuX to be rebuilt in its constructor (bug 1923666). However, this interferes with some menus, such as the Window and the Edit menu, since macOS adds its own menu items to these menus. This patch expands the fix for bug 1939346 for the Window menu to also include the Edit menu, where the Emoji picker is added as a menu item.

2. Bug 1808223 addressed a regression due to a macOS bug where the emoji picker and the dictation menu item are added every time that a main menu bar is set for an app, but macOS 'forgets' to remove these items when switched away from one Firefox window to another and back again. One quirk about this is that if the user switches to another APP and back to the same Firefox window, macOS will not re-add these menu items to the edit menu again. So we need to avoid removing these problematic menu items in this situation. I was hoping to implement a fix that would simply remove duplicates *after* setting the `NSApp.mainMenu`, but if we do so then macOS will remove ALL added menu items and the emoji picker will disappear entirely from the Edit menu. So this appears to be the only way to properly fix this.

Differential Revision: https://phabricator.services.mozilla.com/D268239
2025-10-28 22:28:31 +00:00
..