diff --git a/widget/gtk/nsNativeThemeGTK.cpp b/widget/gtk/nsNativeThemeGTK.cpp index 6151c946a652b52c92552382004ccc3a438dfa9b..38129a3b2671f6301c1f95d9d2d41e5ba671bde9 100644 --- a/widget/gtk/nsNativeThemeGTK.cpp +++ b/widget/gtk/nsNativeThemeGTK.cpp @@ -61,16 +61,10 @@ using namespace mozilla::widget; static int gLastGdkError; // Return widget scale factor of the monitor where the window is located by the -// most part. -// We prefer the root widget scale since it doesn't account for text scale -// factor, this is the same scrollbars do in GTK. +// most part. We intentionally honor the text scale factor here in order to +// have consistent scaling with other UI elements. static inline CSSToLayoutDeviceScale GetWidgetScaleFactor(nsIFrame* aFrame) { - nsPresContext* pc = aFrame->PresContext(); - nsIWidget* rootWidget = pc->GetRootWidget(); - auto scale = - rootWidget ? rootWidget->GetDefaultScale() : pc->CSSToDevPixelScale(); - scale.scale = std::max(1.0f, std::round(scale.scale)); - return scale; + return aFrame->PresContext()->CSSToDevPixelScale(); } nsNativeThemeGTK::nsNativeThemeGTK() : Theme(ScrollbarStyle()) {