Bug 1706816 - If we're asked to open a native menu when another menu is already open, close the other menu first. r=harry

Differential Revision: https://phabricator.services.mozilla.com/D113048
This commit is contained in:
Markus Stange 2021-04-22 01:27:25 +00:00
Родитель 46ddaffa50
Коммит d92a3be6fd
1 изменённых файлов: 3 добавлений и 1 удалений

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

@ -774,7 +774,9 @@ bool nsXULPopupManager::ShowPopupAsNativeMenu(nsIContent* aPopup, int32_t aXPos,
Event* aTriggerEvent) {
if (mNativeMenu) {
NS_WARNING("Native menu still open when trying to open another");
mNativeMenu->RemoveObserver(this);
RefPtr<NativeMenu> menu = mNativeMenu;
(void)menu->Close();
menu->RemoveObserver(this);
mNativeMenu = nullptr;
}