diff --git a/layout/xul/nsMenuPopupFrame.cpp b/layout/xul/nsMenuPopupFrame.cpp index 180bf92d05fa..d2cf5970d3b0 100644 --- a/layout/xul/nsMenuPopupFrame.cpp +++ b/layout/xul/nsMenuPopupFrame.cpp @@ -245,8 +245,8 @@ nsPopupLevel nsMenuPopupFrame::PopupLevel(bool aIsNoAutoHide) const { void nsMenuPopupFrame::EnsureWidget(bool aRecreate) { nsView* ourView = GetView(); - auto* widget = GetWidget(); - if (aRecreate || (widget && widget->NeedsRecreateToReshow())) { + if (aRecreate) { + auto* widget = GetWidget(); if (widget) { // Widget's WebRender resources needs to be cleared before creating new // widget. diff --git a/widget/cocoa/nsCocoaWindow.h b/widget/cocoa/nsCocoaWindow.h index 6b9184b6908a..04634f2b5880 100644 --- a/widget/cocoa/nsCocoaWindow.h +++ b/widget/cocoa/nsCocoaWindow.h @@ -226,8 +226,6 @@ class nsCocoaWindow final : public nsBaseWidget, public nsPIWidgetCocoa { virtual void Destroy() override; virtual void Show(bool aState) override; - virtual bool NeedsRecreateToReshow() override; - virtual nsIWidget* GetSheetWindowParent(void) override; virtual void Enable(bool aState) override; virtual bool IsEnabled() const override; diff --git a/widget/cocoa/nsCocoaWindow.mm b/widget/cocoa/nsCocoaWindow.mm index 1f25ef11c74c..c01543138ac5 100644 --- a/widget/cocoa/nsCocoaWindow.mm +++ b/widget/cocoa/nsCocoaWindow.mm @@ -487,14 +487,6 @@ nsresult nsCocoaWindow::CreateNativeWindow(const NSRect& aRect, nsBorderStyle aB SetPopupWindowLevel(); [mWindow setBackgroundColor:[NSColor clearColor]]; [mWindow setOpaque:NO]; - - // When multiple spaces are in use and the browser is assigned to a - // particular space, override the "Assign To" space and display popups on - // the active space. Does not work with multiple displays. See - // NeedsRecreateToReshow() for multi-display with multi-space workaround. - NSWindowCollectionBehavior behavior = [mWindow collectionBehavior]; - behavior |= NSWindowCollectionBehaviorMoveToActiveSpace; - [mWindow setCollectionBehavior:behavior]; } else { // Make sure that regular windows are opaque from the start, so that // nsChildView::WidgetTypeSupportsAcceleration returns true for them. @@ -965,17 +957,6 @@ void nsCocoaWindow::Show(bool bState) { NS_OBJC_END_TRY_ABORT_BLOCK; } -// Work around a problem where with multiple displays and multiple spaces -// enabled, where the browser is assigned to a single display or space, popup -// windows that are reshown after being hidden with [NSWindow orderOut] show on -// the assigned space even when opened from another display. Apply the -// workaround whenever more than one display is enabled. -bool nsCocoaWindow::NeedsRecreateToReshow() { - // Limit the workaround to popup windows because only they need to override - // the "Assign To" setting. i.e., to display where the parent window is. - return (mWindowType == eWindowType_popup) && ([[NSScreen screens] count] > 1); -} - struct ShadowParams { float standardDeviation; float density; diff --git a/widget/nsIWidget.h b/widget/nsIWidget.h index ee82d8f5a1b3..a2d840be1ece 100644 --- a/widget/nsIWidget.h +++ b/widget/nsIWidget.h @@ -647,12 +647,6 @@ class nsIWidget : public nsISupports { */ virtual void Show(bool aState) = 0; - /** - * Whether or not a widget must be recreated after being hidden to show - * again properly. - */ - virtual bool NeedsRecreateToReshow() { return false; } - /** * Make the window modal. */