From f5d85dbba6307ac3cc252d39ae1dcc33423b11c9 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Thu, 28 Jun 2018 23:12:08 +0200 Subject: [PATCH] Convert the button rect to device coordinates correctly instead of casting CSS coordinates. This should the correct fix for #559 --- dom/base/nsGlobalWindow.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index 4e384c4d21..884ad69ca5 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -14633,7 +14633,9 @@ nsGlobalWindow::NotifyDefaultButtonLoaded(Element& aDefaultButton, return; } LayoutDeviceIntRect buttonRect = - LayoutDeviceIntRect::FromUnknownRect(frame->GetScreenRect()); + LayoutDeviceIntRect::FromAppUnitsToNearest( + frame->GetScreenRectInAppUnits(), + frame->PresContext()->AppUnitsPerDevPixel()); // Get the widget rect in screen coordinates. nsIWidget *widget = GetNearestWidget();