Backed out changeset 23e9fe8a919b (bug 1565401) for causing build bustages on nsWindow.h. CLOSED TREE
authorCosmin Sabou <csabou@mozilla.com>
Wed, 16 Oct 2019 18:45:09 +0300
changeset 559221 c6056ecd793e6511ab28803792bea16f107c82b1
parent 559220 35a2a50ef074234912f5f1ad112a424608360d40
child 559222 442ddf37c4ba9e8d6265360576e74d0b2c4b2676
push id12175
push userccoroiu@mozilla.com
push dateThu, 17 Oct 2019 19:29:09 +0000
treeherdermozilla-beta@d333b6ef1fd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1565401
milestone71.0a1
backs out23e9fe8a919bf7315734c8450913c803b45deac3
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 23e9fe8a919b (bug 1565401) for causing build bustages on nsWindow.h. CLOSED TREE
layout/xul/nsMenuPopupFrame.cpp
widget/ScreenManager.cpp
widget/gtk/nsWindow.cpp
widget/gtk/nsWindow.h
widget/moz.build
widget/nsIWidget.h
--- a/layout/xul/nsMenuPopupFrame.cpp
+++ b/layout/xul/nsMenuPopupFrame.cpp
@@ -1497,29 +1497,29 @@ nsresult nsMenuPopupFrame::SetPopupPosit
     // Other OS screen positioned popups can be flipped vertically but never
     // horizontally
     vFlip = FlipStyle_Outside;
 #endif  // #ifdef XP_MACOSX
   }
 
   nscoord oldAlignmentOffset = mAlignmentOffset;
 
-  static bool inWayland = false;
+  bool inWayland = false;
 #ifdef MOZ_WAYLAND
   inWayland = !GDK_IS_X11_DISPLAY(gdk_display_get_default());
 #endif
 
   // If a panel is being moved or has flip="none", don't constrain or flip it,
   // in order to avoid visual noise when moving windows between screens.
   // However, if a panel is already constrained or flipped (mIsOffset), then we
   // want to continue to calculate this. Also, always do this for content
   // shells, so that the popup doesn't extend outside the containing frame.
-  if (mInContentShell ||
-      (mFlip != FlipType_None &&
-       (!aIsMove || mIsOffset || mPopupType != ePopupTypePanel))) {
+  if (!inWayland && (mInContentShell || (mFlip != FlipType_None &&
+                                         (!aIsMove || mIsOffset ||
+                                          mPopupType != ePopupTypePanel)))) {
     int32_t appPerDev = presContext->AppUnitsPerDevPixel();
     LayoutDeviceIntRect anchorRectDevPix =
         LayoutDeviceIntRect::FromAppUnitsToNearest(anchorRect, appPerDev);
     LayoutDeviceIntRect rootScreenRectDevPix =
         LayoutDeviceIntRect::FromAppUnitsToNearest(rootScreenRect, appPerDev);
     LayoutDeviceIntRect screenRectDevPix =
         GetConstraintRect(anchorRectDevPix, rootScreenRectDevPix, popupLevel);
     nsRect screenRect =
@@ -1527,76 +1527,70 @@ nsresult nsMenuPopupFrame::SetPopupPosit
 
     // Ensure that anchorRect is on screen.
     anchorRect = anchorRect.Intersect(screenRect);
 
     // shrink the the popup down if it is larger than the screen size
     if (mRect.width > screenRect.width) mRect.width = screenRect.width;
     if (mRect.height > screenRect.height) mRect.height = screenRect.height;
 
-    // We can't get the subsequent change of the popup position under
-    // waylande where gdk_window_move_to_rect is used to place them
-    // because we don't know the absolute position of the window on the screen.
-    if (!inWayland) {
-      // at this point the anchor (anchorRect) is within the available screen
-      // area (screenRect) and the popup is known to be no larger than the
-      // screen.
+    // at this point the anchor (anchorRect) is within the available screen
+    // area (screenRect) and the popup is known to be no larger than the screen.
 
-      // We might want to "slide" an arrow if the panel is of the correct type -
-      // but we can only slide on one axis - the other axis must be "flipped or
-      // resized" as normal.
-      bool slideHorizontal = false, slideVertical = false;
-      if (mFlip == FlipType_Slide) {
-        int8_t position = GetAlignmentPosition();
-        slideHorizontal = position >= POPUPPOSITION_BEFORESTART &&
-                          position <= POPUPPOSITION_AFTEREND;
-        slideVertical = position >= POPUPPOSITION_STARTBEFORE &&
-                        position <= POPUPPOSITION_ENDAFTER;
-      }
+    // We might want to "slide" an arrow if the panel is of the correct type -
+    // but we can only slide on one axis - the other axis must be "flipped or
+    // resized" as normal.
+    bool slideHorizontal = false, slideVertical = false;
+    if (mFlip == FlipType_Slide) {
+      int8_t position = GetAlignmentPosition();
+      slideHorizontal = position >= POPUPPOSITION_BEFORESTART &&
+                        position <= POPUPPOSITION_AFTEREND;
+      slideVertical = position >= POPUPPOSITION_STARTBEFORE &&
+                      position <= POPUPPOSITION_ENDAFTER;
+    }
 
-      // Next, check if there is enough space to show the popup at full size
-      // when positioned at screenPoint. If not, flip the popups to the opposite
-      // side of their anchor point, or resize them as necessary.
-      bool endAligned = IsDirectionRTL()
-                            ? mPopupAlignment == POPUPALIGNMENT_TOPLEFT ||
-                                  mPopupAlignment == POPUPALIGNMENT_BOTTOMLEFT
-                            : mPopupAlignment == POPUPALIGNMENT_TOPRIGHT ||
-                                  mPopupAlignment == POPUPALIGNMENT_BOTTOMRIGHT;
-      nscoord preOffsetScreenPoint = screenPoint.x;
-      if (slideHorizontal) {
-        mRect.width = SlideOrResize(screenPoint.x, mRect.width, screenRect.x,
-                                    screenRect.XMost(), &mAlignmentOffset);
-      } else {
-        mRect.width = FlipOrResize(
-            screenPoint.x, mRect.width, screenRect.x, screenRect.XMost(),
-            anchorRect.x, anchorRect.XMost(), margin.left, margin.right,
-            offsetForContextMenu.x, hFlip, endAligned, &mHFlip);
-      }
-      mIsOffset = preOffsetScreenPoint != screenPoint.x;
+    // Next, check if there is enough space to show the popup at full size when
+    // positioned at screenPoint. If not, flip the popups to the opposite side
+    // of their anchor point, or resize them as necessary.
+    bool endAligned = IsDirectionRTL()
+                          ? mPopupAlignment == POPUPALIGNMENT_TOPLEFT ||
+                                mPopupAlignment == POPUPALIGNMENT_BOTTOMLEFT
+                          : mPopupAlignment == POPUPALIGNMENT_TOPRIGHT ||
+                                mPopupAlignment == POPUPALIGNMENT_BOTTOMRIGHT;
+    nscoord preOffsetScreenPoint = screenPoint.x;
+    if (slideHorizontal) {
+      mRect.width = SlideOrResize(screenPoint.x, mRect.width, screenRect.x,
+                                  screenRect.XMost(), &mAlignmentOffset);
+    } else {
+      mRect.width = FlipOrResize(
+          screenPoint.x, mRect.width, screenRect.x, screenRect.XMost(),
+          anchorRect.x, anchorRect.XMost(), margin.left, margin.right,
+          offsetForContextMenu.x, hFlip, endAligned, &mHFlip);
+    }
+    mIsOffset = preOffsetScreenPoint != screenPoint.x;
 
-      endAligned = mPopupAlignment == POPUPALIGNMENT_BOTTOMLEFT ||
-                   mPopupAlignment == POPUPALIGNMENT_BOTTOMRIGHT;
-      preOffsetScreenPoint = screenPoint.y;
-      if (slideVertical) {
-        mRect.height = SlideOrResize(screenPoint.y, mRect.height, screenRect.y,
-                                     screenRect.YMost(), &mAlignmentOffset);
-      } else {
-        mRect.height = FlipOrResize(
-            screenPoint.y, mRect.height, screenRect.y, screenRect.YMost(),
-            anchorRect.y, anchorRect.YMost(), margin.top, margin.bottom,
-            offsetForContextMenu.y, vFlip, endAligned, &mVFlip);
-      }
-      mIsOffset = mIsOffset || (preOffsetScreenPoint != screenPoint.y);
+    endAligned = mPopupAlignment == POPUPALIGNMENT_BOTTOMLEFT ||
+                 mPopupAlignment == POPUPALIGNMENT_BOTTOMRIGHT;
+    preOffsetScreenPoint = screenPoint.y;
+    if (slideVertical) {
+      mRect.height = SlideOrResize(screenPoint.y, mRect.height, screenRect.y,
+                                   screenRect.YMost(), &mAlignmentOffset);
+    } else {
+      mRect.height = FlipOrResize(
+          screenPoint.y, mRect.height, screenRect.y, screenRect.YMost(),
+          anchorRect.y, anchorRect.YMost(), margin.top, margin.bottom,
+          offsetForContextMenu.y, vFlip, endAligned, &mVFlip);
+    }
+    mIsOffset = mIsOffset || (preOffsetScreenPoint != screenPoint.y);
 
-      NS_ASSERTION(screenPoint.x >= screenRect.x &&
-                       screenPoint.y >= screenRect.y &&
-                       screenPoint.x + mRect.width <= screenRect.XMost() &&
-                       screenPoint.y + mRect.height <= screenRect.YMost(),
-                   "Popup is offscreen");
-    }
+    NS_ASSERTION(screenPoint.x >= screenRect.x &&
+                     screenPoint.y >= screenRect.y &&
+                     screenPoint.x + mRect.width <= screenRect.XMost() &&
+                     screenPoint.y + mRect.height <= screenRect.YMost(),
+                 "Popup is offscreen");
   }
 
   // snap the popup's position in screen coordinates to device pixels,
   // see bug 622507, bug 961431
   screenPoint.x = presContext->RoundAppUnitsToNearestDevPixels(screenPoint.x);
   screenPoint.y = presContext->RoundAppUnitsToNearestDevPixels(screenPoint.y);
 
   // determine the x and y position of the view by subtracting the desired
@@ -1688,24 +1682,16 @@ LayoutDeviceIntRect nsMenuPopupFrame::Ge
       // get the total screen area if the popup is allowed to overlap it.
       if (!dontOverlapOSBar && mMenuCanOverlapOSBar && !mInContentShell)
         screen->GetRect(&screenRectPixels.x, &screenRectPixels.y,
                         &screenRectPixels.width, &screenRectPixels.height);
       else
         screen->GetAvailRect(&screenRectPixels.x, &screenRectPixels.y,
                              &screenRectPixels.width, &screenRectPixels.height);
     }
-#ifdef MOZ_WAYLAND
-    else {
-      if (GetWidget() &&
-          GetWidget()->GetScreenRect(&screenRectPixels) != NS_OK) {
-        NS_WARNING("Cannot get screen rect from widget!");
-      }
-    }
-#endif
   }
 
   if (mInContentShell) {
     // for content shells, clip to the client area rather than the screen area
     screenRectPixels.IntersectRect(screenRectPixels, aRootScreenRect);
   } else if (!mOverrideConstraintRect.IsEmpty()) {
     LayoutDeviceIntRect overrideConstrainRect =
         LayoutDeviceIntRect::FromAppUnitsToNearest(
--- a/widget/ScreenManager.cpp
+++ b/widget/ScreenManager.cpp
@@ -6,21 +6,16 @@
 
 #include "ScreenManager.h"
 
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/dom/ContentParent.h"
 #include "mozilla/dom/DOMTypes.h"
 #include "mozilla/Logging.h"
 #include "mozilla/StaticPtr.h"
-#ifdef MOZ_WAYLAND
-#  include <gdk/gdk.h>
-#  include <gdk/gdkx.h>
-#  include <gdk/gdkwayland.h>
-#endif /* MOZ_WAYLAND */
 
 static mozilla::LazyLogModule sScreenLog("WidgetScreen");
 
 namespace mozilla {
 namespace widget {
 
 NS_IMPL_ISUPPORTS(ScreenManager, nsIScreenManager)
 
@@ -104,25 +99,16 @@ void ScreenManager::CopyScreensToAllRemo
 // Returns the screen that contains the rectangle. If the rect overlaps
 // multiple screens, it picks the screen with the greatest area of intersection.
 //
 // The coordinates are in desktop pixels.
 //
 NS_IMETHODIMP
 ScreenManager::ScreenForRect(int32_t aX, int32_t aY, int32_t aWidth,
                              int32_t aHeight, nsIScreen** aOutScreen) {
-#ifdef MOZ_WAYLAND
-  static bool inWayland = !GDK_IS_X11_DISPLAY(gdk_display_get_default());
-
-  if (inWayland) {
-    *aOutScreen = nullptr;
-    return NS_OK;
-  }
-#endif
-
   if (mScreenList.IsEmpty()) {
     MOZ_LOG(sScreenLog, LogLevel::Warning,
             ("No screen available. This can happen in xpcshell."));
     RefPtr<Screen> ret = new Screen(
         LayoutDeviceIntRect(), LayoutDeviceIntRect(), 0, 0,
         DesktopToLayoutDeviceScale(), CSSToLayoutDeviceScale(), 96 /* dpi */);
     ret.forget(aOutScreen);
     return NS_OK;
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -1289,24 +1289,20 @@ GtkWidget* nsWindow::ConfigureWaylandPop
   return GTK_WIDGET(parentGtkWindow);
 }
 
 #ifdef DEBUG
 static void NativeMoveResizeWaylandPopupCallback(
     GdkWindow* window, const GdkRectangle* flipped_rect,
     const GdkRectangle* final_rect, gboolean flipped_x, gboolean flipped_y,
     void* aWindow) {
-  LOG(("%s [%p] flipped_x %d flipped_y %d\n", __FUNCTION__, aWindow, flipped_x,
-       flipped_y));
-
-  LOG(("%s [%p] flipped %d %d w:%d h:%d\n", __FUNCTION__, aWindow,
-       flipped_rect->x, flipped_rect->y, flipped_rect->width,
-       flipped_rect->height));
-  LOG(("%s [%p] final %d %d w:%d h:%d\n", __FUNCTION__, aWindow, final_rect->x,
-       final_rect->y, final_rect->width, final_rect->height));
+  LOG(("%s [%p] flipped %d %d\n", __FUNCTION__, aWindow, flipped_rect->x,
+       flipped_rect->y));
+  LOG(("%s [%p] final %d %d\n", __FUNCTION__, aWindow, final_rect->x,
+       final_rect->y));
 }
 #endif
 
 void nsWindow::NativeMoveResizeWaylandPopup(GdkPoint* aPosition,
                                             GdkRectangle* aSize) {
   // Available as of GTK 3.24+
   static auto sGdkWindowMoveToRect = (void (*)(
       GdkWindow*, const GdkRectangle*, GdkGravity, GdkGravity, GdkAnchorHints,
@@ -1383,43 +1379,32 @@ void nsWindow::NativeMoveResizeWaylandPo
       (gboolean(*)(GtkWidget*))dlsym(RTLD_DEFAULT, "gtk_widget_is_visible");
 
   bool isWidgetVisible =
       (sGtkWidgetIsVisible != nullptr) && sGtkWidgetIsVisible(mShell);
   if (isWidgetVisible) {
     HideWaylandWindow();
   }
 
-  LOG(
-      ("nsWindow::NativeMoveResizeWaylandPopup [%p]: requested rect: x%d y%d "
-       "w%d h%d\n",
-       this, rect.x, rect.y, rect.width, rect.height));
-  if (aSize) {
-    LOG(("  aSize: x%d y%d w%d h%d\n", aSize->x, aSize->y, aSize->width,
-         aSize->height));
-  } else {
-    LOG(("  No aSize given"));
-  }
   sGdkWindowMoveToRect(gdkWindow, &rect, rectAnchor, menuAnchor, hints, 0, 0);
 
   if (isWidgetVisible) {
     // We show the popup with the same configuration so no need to call
     // ConfigureWaylandPopupWindows() before gtk_widget_show().
     gtk_widget_show(mShell);
   }
 }
 
 void nsWindow::NativeMove() {
   GdkPoint point = DevicePixelsToGdkPointRoundDown(mBounds.TopLeft());
 
   LOG(("nsWindow::NativeMove [%p] %d %d\n", (void*)this, point.x, point.y));
 
   if (IsWaylandPopup()) {
-    GdkRectangle size = DevicePixelsToGdkSizeRoundUp(mBounds.Size());
-    NativeMoveResizeWaylandPopup(&point, &size);
+    NativeMoveResizeWaylandPopup(&point, nullptr);
   } else if (mIsTopLevel) {
     gtk_window_move(GTK_WINDOW(mShell), point.x, point.y);
   } else if (mGdkWindow) {
     gdk_window_move(mGdkWindow, point.x, point.y);
   }
 }
 
 void nsWindow::SetZIndex(int32_t aZIndex) {
@@ -6734,35 +6719,30 @@ void nsWindow::SetDrawsInTitlebar(bool a
     if (mDrawInTitlebar && mSizeState == nsSizeMode_Normal) {
       UpdateTitlebarTransparencyBitmap();
     } else {
       ClearTransparencyBitmap();
     }
   }
 }
 
-GtkWindow* nsWindow::GetCurrentTopmostWindow() {
-  GtkWindow* parentWindow = GTK_WINDOW(GetGtkWidget());
-  GtkWindow* topmostParentWindow;
-  while (parentWindow) {
-    topmostParentWindow = parentWindow;
-    parentWindow = gtk_window_get_transient_for(parentWindow);
-  }
-  return topmostParentWindow;
-}
-
 gint nsWindow::GdkScaleFactor() {
   GdkWindow* scaledGdkWindow = mGdkWindow;
   if (!mIsX11Display) {
     // For popup windows/dialogs with parent window we need to get scale factor
     // of the topmost window. Otherwise the scale factor of the popup is
     // not updated during it's hidden.
     if (mWindowType == eWindowType_popup || mWindowType == eWindowType_dialog) {
       // Get toplevel window for scale factor:
-      GtkWindow* topmostParentWindow = GetCurrentTopmostWindow();
+      GtkWindow* parentWindow = GTK_WINDOW(GetGtkWidget());
+      GtkWindow* topmostParentWindow;
+      while (parentWindow) {
+        topmostParentWindow = parentWindow;
+        parentWindow = gtk_window_get_transient_for(parentWindow);
+      }
       if (topmostParentWindow) {
         scaledGdkWindow =
             gtk_widget_get_window(GTK_WIDGET(topmostParentWindow));
       } else {
         NS_WARNING("Popup/Dialog has no parent.");
       }
       // Fallback for windows which parent has been unrealized.
       if (!scaledGdkWindow) {
@@ -7283,49 +7263,16 @@ already_AddRefed<nsIWidget> nsIWidget::C
   return window.forget();
 }
 
 already_AddRefed<nsIWidget> nsIWidget::CreateChildWindow() {
   nsCOMPtr<nsIWidget> window = new nsWindow();
   return window.forget();
 }
 
-nsresult nsWindow::GetScreenRect(LayoutDeviceIntRect* aRect) {
-  typedef struct _GdkMonitor GdkMonitor;
-  static auto s_gdk_display_get_monitor_at_window =
-      (GdkMonitor * (*)(GdkDisplay*, GdkWindow*))
-          dlsym(RTLD_DEFAULT, "gdk_display_get_monitor_at_window");
-
-  static auto s_gdk_monitor_get_workarea =
-      (void (*)(GdkMonitor*, GdkRectangle*))dlsym(RTLD_DEFAULT,
-                                                  "gdk_monitor_get_workarea");
-
-  if (!s_gdk_display_get_monitor_at_window || !s_gdk_monitor_get_workarea) {
-    return NS_ERROR_NOT_IMPLEMENTED;
-  }
-
-  GtkWindow* topmostParentWindow = GetCurrentTopmostWindow();
-  GdkWindow* gdkWindow = gtk_widget_get_window(GTK_WIDGET(topmostParentWindow));
-
-  GdkMonitor* monitor =
-      s_gdk_display_get_monitor_at_window(gdk_display_get_default(), gdkWindow);
-  if (monitor) {
-    GdkRectangle workArea;
-    s_gdk_monitor_get_workarea(monitor, &workArea);
-    aRect->x = workArea.x;
-    aRect->y = workArea.y;
-    aRect->width = workArea.width;
-    aRect->height = workArea.height;
-    LOG(("  workarea for [%p], monitor %p: x%d y%d w%d h%d\n", this, monitor,
-         workArea.x, workArea.y, workArea.width, workArea.height));
-    return NS_OK;
-  }
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
 bool nsWindow::GetTopLevelWindowActiveState(nsIFrame* aFrame) {
   // Used by window frame and button box rendering. We can end up in here in
   // the content process when rendering one of these moz styles freely in a
   // page. Fail in this case, there is no applicable window focus state.
   if (!XRE_IsParentProcess()) {
     return false;
   }
   // All headless windows are considered active so they are painted.
--- a/widget/gtk/nsWindow.h
+++ b/widget/gtk/nsWindow.h
@@ -393,17 +393,16 @@ class nsWindow final : public nsBaseWidg
    * Get the support of Client Side Decoration by checking
    * the XDG_CURRENT_DESKTOP environment variable.
    */
   static CSDSupportLevel GetSystemCSDSupportLevel();
 
   static bool HideTitlebarByDefault();
   static bool GetTopLevelWindowActiveState(nsIFrame* aFrame);
   static bool TitlebarCanUseShapeMask();
-  virtual nsresult GetScreenRect(LayoutDeviceIntRect* aRect) override;
 
  protected:
   virtual ~nsWindow();
 
   // event handling code
   void DispatchActivateEvent(void);
   void DispatchDeactivateEvent(void);
   void DispatchResized();
@@ -626,17 +625,16 @@ class nsWindow final : public nsBaseWidg
   void SetPopupWindowDecoration(bool aShowOnTaskbar);
 
   bool IsMainMenuWindow();
   GtkWidget* ConfigureWaylandPopupWindows();
   void HideWaylandWindow();
   void HideWaylandTooltips();
   void HideWaylandPopupAndAllChildren();
   void CleanupWaylandPopups();
-  GtkWindow* GetCurrentTopmostWindow();
 
   /**
    * |mIMContext| takes all IME related stuff.
    *
    * This is owned by the top-level nsWindow or the topmost child
    * nsWindow embedded in a non-Gecko widget.
    *
    * The instance is created when the top level widget is created.  And when
--- a/widget/moz.build
+++ b/widget/moz.build
@@ -205,16 +205,17 @@ UNIFIED_SOURCES += [
     'nsPrimitiveHelpers.cpp',
     'nsPrintSettingsImpl.cpp',
     'nsSoundProxy.cpp',
     'nsTransferable.cpp',
     'nsXPLookAndFeel.cpp',
     'PuppetBidiKeyboard.cpp',
     'PuppetWidget.cpp',
     'Screen.cpp',
+    'ScreenManager.cpp',
     'SharedWidgetUtils.cpp',
     'TextEventDispatcher.cpp',
     'VsyncDispatcher.cpp',
     'WidgetEventImpl.cpp',
     'WidgetUtils.cpp',
 ]
 
 if CONFIG['OS_ARCH'] == 'Linux':
@@ -236,17 +237,16 @@ if CONFIG['MOZ_XUL'] and CONFIG['NS_PRIN
         'nsPrintSettingsService.cpp',
     ]
 
 # nsBaseWidget.cpp needs to be built separately because of name clashes in the OS X headers
 # nsBaseDragService.cpp moved out of UNIFIED to fix xgill crash (bug 1259850) after moving widget/ContentHelper -> apz/util/TouchActionHelper
 SOURCES += [
     'nsBaseDragService.cpp',
     'nsBaseWidget.cpp',
-    'ScreenManager.cpp',
 ]
 
 if CONFIG['MOZ_INSTRUMENT_EVENT_LOOP']:
     EXPORTS.mozilla += [
         'WidgetTraceEvent.h',
     ]
 
 EXPORTS.ipc = ['nsGUIEventIPC.h']
--- a/widget/nsIWidget.h
+++ b/widget/nsIWidget.h
@@ -1708,25 +1708,16 @@ class nsIWidget : public nsISupports {
 
   virtual nsresult SetPrefersReducedMotionOverrideForTest(bool aValue) {
     return NS_ERROR_NOT_IMPLEMENTED;
   }
   virtual nsresult ResetPrefersReducedMotionOverrideForTest() {
     return NS_ERROR_NOT_IMPLEMENTED;
   }
 
-  // Get rectangle of the screen where the window is placed.
-  // It's used to detect popup overflow under Wayland because
-  // Screenmanager does not work under it.
-#ifdef MOZ_WAYLAND
-  virtual nsresult GetScreenRect(LayoutDeviceIntRect* aRect) {
-    return NS_ERROR_NOT_IMPLEMENTED;
-  }
-#endif
-
  private:
   class LongTapInfo {
    public:
     LongTapInfo(int32_t aPointerId, LayoutDeviceIntPoint& aPoint,
                 mozilla::TimeDuration aDuration, nsIObserver* aObserver)
         : mPointerId(aPointerId),
           mPosition(aPoint),
           mDuration(aDuration),