Commit b6f99ae0 authored by stransky's avatar stransky
Browse files

Bug 1718727 [Wayland] Don't constrain mouse events by screen size on Wayland, r=emilio

parent 17054700
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -33,6 +33,13 @@

using namespace mozilla;

#ifdef MOZ_WAYLAND
#  include "mozilla/WidgetUtilsGtk.h"
#  define IS_WAYLAND_DISPLAY() mozilla::widget::GdkIsWaylandDisplay()
#else
#  define IS_WAYLAND_DISPLAY() false
#endif

//
// NS_NewResizerFrame
//
@@ -191,7 +198,9 @@ nsresult nsResizerFrame::HandleEvent(nsPresContext* aPresContext,

        // Don't allow resizing a window or a popup past the edge of the screen,
        // so adjust the rectangle to fit within the available screen area.
        if (window) {
        // Don't check it on Wayland as we can't get absolute window position
        // there.
        if (window && !IS_WAYLAND_DISPLAY()) {
          nsCOMPtr<nsIScreen> screen;
          nsCOMPtr<nsIScreenManager> sm(
              do_GetService("@mozilla.org/gfx/screenmanager;1"));
@@ -210,7 +219,7 @@ nsresult nsResizerFrame::HandleEvent(nsPresContext* aPresContext,
              rect.IntersectRect(rect, screenRect);
            }
          }
        } else if (menuPopupFrame) {
        } else if (menuPopupFrame && !IS_WAYLAND_DISPLAY()) {
          nsRect frameRect = menuPopupFrame->GetScreenRectInAppUnits();
          nsIFrame* rootFrame = aPresContext->PresShell()->GetRootFrame();
          nsRect rootScreenRect = rootFrame->GetScreenRectInAppUnits();