Backed out changeset 6776dac63175 (bug 1498973) for regression from bug 1534935 FENNEC_66_0_BUILD3 FIREFOX_66_0_BUILD3
authorDorel Luca <dluca@mozilla.com>
Thu, 14 Mar 2019 19:46:30 +0200
changeset 516377 164a57c0cdf0
parent 516376 7e79197b95a2
child 516378 8e4dc475f00c
push id1970
push userdluca@mozilla.com
push dateThu, 14 Mar 2019 17:47:25 +0000
treeherdermozilla-release@164a57c0cdf0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1498973, 1534935
milestone66.0
backs out6776dac63175
Backed out changeset 6776dac63175 (bug 1498973) for regression from bug 1534935
view/nsView.cpp
view/nsView.h
widget/nsIWidgetListener.cpp
widget/nsIWidgetListener.h
widget/windows/nsWindow.cpp
--- a/view/nsView.cpp
+++ b/view/nsView.cpp
@@ -1036,25 +1036,16 @@ void nsView::DidCompositeWindow(mozilla:
 
 void nsView::RequestRepaint() {
   nsIPresShell* presShell = mViewManager->GetPresShell();
   if (presShell) {
     presShell->ScheduleViewManagerFlush();
   }
 }
 
-bool nsView::ShouldNotBeVisible() {
-  if (mFrame && mFrame->IsMenuPopupFrame()) {
-    nsXULPopupManager* pm = nsXULPopupManager::GetInstance();
-    return !pm || !pm->IsPopupOpen(mFrame->GetContent());
-  }
-
-  return false;
-}
-
 nsEventStatus nsView::HandleEvent(WidgetGUIEvent* aEvent,
                                   bool aUseAttachedEvents) {
   MOZ_ASSERT(nullptr != aEvent->mWidget, "null widget ptr");
 
   nsEventStatus result = nsEventStatus_eIgnore;
   nsView* view;
   if (aUseAttachedEvents) {
     nsIWidgetListener* listener = aEvent->mWidget->GetAttachedWidgetListener();
--- a/view/nsView.h
+++ b/view/nsView.h
@@ -388,17 +388,16 @@ class nsView final : public nsIWidgetLis
   virtual bool PaintWindow(nsIWidget* aWidget,
                            LayoutDeviceIntRegion aRegion) override;
   virtual void DidPaintWindow() override;
   virtual void DidCompositeWindow(
       mozilla::layers::TransactionId aTransactionId,
       const mozilla::TimeStamp& aCompositeStart,
       const mozilla::TimeStamp& aCompositeEnd) override;
   virtual void RequestRepaint() override;
-  virtual bool ShouldNotBeVisible() override;
   virtual nsEventStatus HandleEvent(mozilla::WidgetGUIEvent* aEvent,
                                     bool aUseAttachedEvents) override;
 
   virtual ~nsView();
 
   nsPoint GetOffsetTo(const nsView* aOther, const int32_t aAPD) const;
   nsIWidget* GetNearestWidget(nsPoint* aOffset, const int32_t aAPD) const;
 
--- a/widget/nsIWidgetListener.cpp
+++ b/widget/nsIWidgetListener.cpp
@@ -65,17 +65,12 @@ bool nsIWidgetListener::PaintWindow(nsIW
 void nsIWidgetListener::DidPaintWindow() {}
 
 void nsIWidgetListener::DidCompositeWindow(
     mozilla::layers::TransactionId aTransactionId,
     const TimeStamp& aCompositeStart, const TimeStamp& aCompositeEnd) {}
 
 void nsIWidgetListener::RequestRepaint() {}
 
-bool nsIWidgetListener::ShouldNotBeVisible() {
-  // Returns false to assume that nothing should happen in most cases.
-  return true;
-}
-
 nsEventStatus nsIWidgetListener::HandleEvent(WidgetGUIEvent* aEvent,
                                              bool aUseAttachedEvents) {
   return nsEventStatus_eIgnore;
 }
--- a/widget/nsIWidgetListener.h
+++ b/widget/nsIWidgetListener.h
@@ -158,22 +158,15 @@ class nsIWidgetListener {
                                   const mozilla::TimeStamp& aCompositeEnd);
 
   /**
    * Request that layout schedules a repaint on the next refresh driver tick.
    */
   virtual void RequestRepaint();
 
   /**
-   * Returns true if this is a popup that should not be visible. If this
-   * is a popup that is visible, not a popup or this state is unknown,
-   * returns false.
-   */
-  virtual bool ShouldNotBeVisible();
-
-  /**
    * Handle an event.
    */
   virtual nsEventStatus HandleEvent(mozilla::WidgetGUIEvent* aEvent,
                                     bool aUseAttachedEvents);
 };
 
 #endif
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -6536,26 +6536,16 @@ void nsWindow::OnWindowPosChanging(LPWIN
           info->hwndInsertAfter =
               (HWND)actualBelow->GetNativeData(NS_NATIVE_WINDOW);
         }
       }
     }
   }
   // prevent rude external programs from making hidden window visible
   if (mWindowType == eWindowType_invisible) info->flags &= ~SWP_SHOWWINDOW;
-
-  // When waking from sleep or switching out of tablet mode, Windows 10
-  // Version 1809 will reopen popup windows that should be hidden. Detect
-  // this case and refuse to show the window.
-  static bool sDWMUnhidesPopups = IsWin10Sep2018UpdateOrLater();
-  if (sDWMUnhidesPopups && (info->flags & SWP_SHOWWINDOW) &&
-      mWindowType == eWindowType_popup && mWidgetListener &&
-      mWidgetListener->ShouldNotBeVisible()) {
-    info->flags &= ~SWP_SHOWWINDOW;
-  }
 }
 
 void nsWindow::UserActivity() {
   // Check if we have the idle service, if not we try to get it.
   if (!mIdleService) {
     mIdleService = do_GetService("@mozilla.org/widget/idleservice;1");
   }