Under Wayland it is possible to add only one popup window
to a parent window. If we try to attach another popup to the window,
the GTK refuses to do that. This can happen when the previous popup
has not yet been hidden while the new popup is showing (in some cases
the nsWindow::Show(false) for the previous popup is not called before
nsWindow::Show(true) for the new one).
We deal with it by hiding wayland popups which are no longer in the
XULPopupManager (PM) before showing a new one. We only do that for
the main menu popups or context (sub)menus. We cannot use PM to check
for the panel popup content like Folder dropdown in Edit Bookmark panel
or WebRTC microphone/video source dropdown. In that case we simply use
the last shown popup as a transient for the new one or the toplevel window.