mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1240533 - Parameters to ScreenForRect need to be passed as desktop pixels, not device pixels. r=emk
This commit is contained in:
parent
046dd4c97e
commit
7df35d9cfa
@ -1553,9 +1553,12 @@ nsMenuPopupFrame::GetConstraintRect(const LayoutDeviceIntRect& aAnchorRect,
|
||||
// This is because we need to constrain the content to this content area,
|
||||
// so we should use the same screen. Otherwise, use the screen where the
|
||||
// anchor is located.
|
||||
LayoutDeviceIntRect rect = mInContentShell ? aRootScreenRect : aAnchorRect;
|
||||
int32_t width = std::max(1, rect.width);
|
||||
int32_t height = std::max(1, rect.height);
|
||||
DesktopToLayoutDeviceScale scale =
|
||||
PresContext()->DeviceContext()->GetDesktopToDeviceScale();
|
||||
DesktopRect rect =
|
||||
(mInContentShell ? aRootScreenRect : aAnchorRect) / scale;
|
||||
int32_t width = std::max(1, NSToIntRound(rect.width));
|
||||
int32_t height = std::max(1, NSToIntRound(rect.height));
|
||||
sm->ScreenForRect(rect.x, rect.y, width, height, getter_AddRefs(screen));
|
||||
if (screen) {
|
||||
// Non-top-level popups (which will always be panels)
|
||||
|
Loading…
Reference in New Issue
Block a user