[Webkit-unassigned] [Bug 274351] WebKitGTK WebCore::fontDPI() should depend on display

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 20 10:52:38 PDT 2024


https://bugs.webkit.org/show_bug.cgi?id=274351

--- Comment #2 from Glen Whitney <gwhitneycom5 at pobox.com> ---
Actually, the premise of this original issue report was based on a misconception resulting from an unfortunate terminological conflict between WebKit and Gdk: "PlatformDisplayID" entities in WebKit actually correspond to different GdkMonitor objects, all connected to the same GdkDisplay object; and WebKitGTK currently really only concerns itself with one single GdkDisplay object throughout its lifetime, namely the one returned by gdk_display_get_default(). Thus, although there is a GtkSettings object per GdkDisplay, all of the GdkMonitor entities enumerated by the WebKit PlatformDisplayIDs will relate to the same GdkDisplay, and so will relate to the same GtkSettings object. Since currently fontDPI() essentially depends just on the xft-dpi GtkSetting, adding a PlatformDisplayID parameter to fontDPI() at this time would uselessly end up with the same value regardless of the PlatformDisplayID argument supplied.

So I am changing the title of the issue accordingly. The only point remaining to this issue is that in some circumstances (if monitors of very different device pixel sizes are attached to the default GdkDisplay), it would indeed be behaviorally ideal if there could be a different fontDPI() per monitor (PlatformDisplayID) to scale WebViews more appropriately on different monitors. However, as GTK currently does not provide any mechanism to differentiate the preferred dpi for fonts on different monitors of the same GdkDisplay, it is unclear how WebKitGTK could determine such a per-monitor fontDPI().

(As an aside, I would personally recommend a strategy in which both screenDPI() and fontDPI() were used to determine WebView scaling, such as perhaps to use just fontDPI() on the primary monitor and then on all other monitors scale the page by the screenDPI() for that monitor divided by the screenDPI() for the primary monitor. However, in the long conversations in https://github.com/WebKit/WebKit/pull/26938 and https://github.com/WebKit/WebKit/pull/28691 it was determined in collaboration with the maintainers, primarily Michael Catanzaro, that at least for now to only consider fontDPI() in scaling WebViews. In such a regime, as long as GTK has no notion of different xft-dpi for different monitors, there is no point to a PlatformDisplayID argument to fontDPI().)

I leave it to the maintainers of this issue list whether to leave this issue open in case some future change in either GTK or WebKit's strategy for scaling WebViews would make it possible/worthwhile to have different fontDPI() for different PlatformDisplayIDs (since that could have real behavioral benefits should it ever happen) or to close this issue at this moment since it is currently unactionable, presuming that if something changed in the future to enable this,  a new issue could be opened or this could be reopened. Thanks.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20240520/a7076f17/attachment.htm>


More information about the webkit-unassigned mailing list