blob: 75ea8ce2e52f48113df11e702f21e752b40dee3f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -1593,7 +1593,14 @@
// Get anchor rectangle
LayoutDeviceIntRect anchorRect(0, 0, 0, 0);
nsMenuPopupFrame* popupFrame = GetMenuPopupFrame(GetFrame());
- int32_t p2a = AppUnitsPerCSSPixel() / gfxPlatformGtk::GetFontScaleFactor();
+
+ int32_t p2a;
+ double devPixelsPerCSSPixel = StaticPrefs::layout_css_devPixelsPerPx();
+ if (devPixelsPerCSSPixel > 0.0) {
+ p2a = AppUnitsPerCSSPixel() / devPixelsPerCSSPixel * GdkScaleFactor();
+ } else {
+ p2a = AppUnitsPerCSSPixel() / gfxPlatformGtk::GetFontScaleFactor();
+ }
if (popupFrame) {
#ifdef MOZ_WAYLAND
anchorRect = LayoutDeviceIntRect::FromAppUnitsToOutside(
|