Backed out changeset 09ccf334001b (bug 1592416) for causing bug 1640077 to fail.
authorButkovits Atila <abutkovits@mozilla.com>
Fri, 22 May 2020 09:37:16 +0300
changeset 531586 fbf71e4d2e2142f823ac5d64679448443e25ec99
parent 531585 3afdf3a5bec4902b80f5e67d93ca9f7f9f12edbd
child 531674 d6abd35b54ad39fa030217716b172fa9883bf3c8
push id37440
push userabutkovits@mozilla.com
push dateFri, 22 May 2020 09:43:16 +0000
treeherdermozilla-central@fbf71e4d2e21 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1592416, 1640077
milestone78.0a1
backs out09ccf334001b34afb2e77743d47655300008229f
first release with
nightly linux32
fbf71e4d2e21 / 78.0a1 / 20200522094316 / files
nightly linux64
fbf71e4d2e21 / 78.0a1 / 20200522094316 / files
nightly mac
fbf71e4d2e21 / 78.0a1 / 20200522094316 / files
nightly win32
fbf71e4d2e21 / 78.0a1 / 20200522094316 / files
nightly win64
fbf71e4d2e21 / 78.0a1 / 20200522094316 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 09ccf334001b (bug 1592416) for causing bug 1640077 to fail.
layout/xul/nsMenuPopupFrame.cpp
widget/cocoa/nsCocoaWindow.h
widget/cocoa/nsCocoaWindow.mm
widget/nsIWidget.h
--- a/layout/xul/nsMenuPopupFrame.cpp
+++ b/layout/xul/nsMenuPopupFrame.cpp
@@ -240,18 +240,18 @@ nsPopupLevel nsMenuPopupFrame::PopupLeve
   if (aIsNoAutoHide) return ePopupLevelParent;
 
   // Otherwise, the result depends on the platform.
   return sDefaultLevelIsTop ? ePopupLevelTop : ePopupLevelParent;
 }
 
 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.
       widget->ClearCachedWebrenderResources();
     }
     ourView->DestroyWidget();
   }
   if (!ourView->HasWidget()) {
--- a/widget/cocoa/nsCocoaWindow.h
+++ b/widget/cocoa/nsCocoaWindow.h
@@ -221,18 +221,16 @@ class nsCocoaWindow final : public nsBas
 
   [[nodiscard]] virtual nsresult Create(nsIWidget* aParent, nsNativeWidget aNativeParent,
                                         const LayoutDeviceIntRect& aRect,
                                         nsWidgetInitData* aInitData = nullptr) override;
 
   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;
   virtual void SetModal(bool aState) override;
   virtual void SetFakeModal(bool aState) override;
   virtual bool IsRunningAppModal() override;
   virtual bool IsVisible() const override;
   virtual void SetFocus(Raise, mozilla::dom::CallerType aCallerType) override;
--- a/widget/cocoa/nsCocoaWindow.mm
+++ b/widget/cocoa/nsCocoaWindow.mm
@@ -482,24 +482,16 @@ nsresult nsCocoaWindow::CreateNativeWind
   if (mWindowType == eWindowType_invisible) {
     [mWindow setLevel:kCGDesktopWindowLevelKey];
   }
 
   if (mWindowType == eWindowType_popup) {
     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.
     [mWindow setOpaque:YES];
   }
 
   NSWindowCollectionBehavior newBehavior = [mWindow collectionBehavior];
   if (mAlwaysOnTop) {
@@ -960,27 +952,16 @@ void nsCocoaWindow::Show(bool bState) {
     }
   }
 
   [mWindow setBeingShown:NO];
 
   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;
   int offsetX;
   int offsetY;
   unsigned int flags;
 };
 
--- a/widget/nsIWidget.h
+++ b/widget/nsIWidget.h
@@ -643,22 +643,16 @@ class nsIWidget : public nsISupports {
    * Show or hide this widget
    *
    * @param aState true to show the Widget, false to hide it
    *
    */
   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.
    */
   virtual void SetModal(bool aModal) = 0;
 
   /**
    * Make the non-modal window opened by modal window fake-modal, that will
    * call SetFakeModal(false) on destroy on Cocoa.
    */