Bug 1648881 - Right click submenus opening on the wrong screen r=spohl

Apply the fix for bug 1592416 to submenus.

This adds the NSWindowCollectionBehaviorMoveToActiveSpace behavior to
submenu popups so that they override the "Assign To" space setting and display
on the active space. And, when mutiple displays are in use, recreates the
submenu widget each time it is displayed.

Differential Revision: https://phabricator.services.mozilla.com/D81812
This commit is contained in:
Haik Aftandilian 2020-07-01 14:20:40 +00:00
parent 795767fefa
commit b6be654b88

View File

@ -720,7 +720,9 @@ void nsMenuPopupFrame::InitializePopup(nsIContent* aAnchorContent,
int32_t aXPos, int32_t aYPos,
MenuPopupAnchorType aAnchorType,
bool aAttributesOverride) {
EnsureWidget();
auto* widget = GetWidget();
bool recreateWidget = widget && widget->NeedsRecreateToReshow();
EnsureWidget(recreateWidget);
mPopupState = ePopupShowing;
mAnchorContent = aAnchorContent;