[Webkit-unassigned] [Bug 274351] Could WebKitGTK WebCore::fontDPI() depend on monitor (PlatformDisplayID)?

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 20 14:27:34 PDT 2024


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

Michael Catanzaro <mcatanzaro at redhat.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mcatanzaro at redhat.com

--- Comment #3 from Michael Catanzaro <mcatanzaro at redhat.com> ---
Ah, well I mixed up GdkDisplay and GdkMonitor because I'm insufficiently familiar with GDK/GTK.

I think what we're *supposed* to do is get the GdkDisplay to use using gtk_widget_get_display() on the WebKitWebView. But I'm honestly not sure what a GdkDisplay truly corresponds to or under what conditions there might be more than one. I guess it's the window system concept of a display, like wayland-0 or :0? Not sure how apps would support use of more than one. Anyway, I suspect this is probably not actually terribly relevant for the purposes of this issue.

> (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().)

OK, I didn't intend "don't consider screenDPI at all" but rather "treat fontDPI as a multiplier to the screenDPI rather than as a fonts-only setting." So I see now that refreshInternalScaling in WebKitWebViewBase.cpp is not considering screenDPI at all. Why not do something like:

double newPageScale = WebCore::fontDPI() / WebCore::screenDPI(webViewBase->priv->displayID);

and use 96. as the fallback only if WebCore::screenDPI would return 0? I assume I'm either misunderstanding or missing something important?

-- 
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/66c7605c/attachment.htm>


More information about the webkit-unassigned mailing list