mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
38164411f0
Some Wayland compositors have support of fractional-scale-v1 protocol. The protocol allows compositor to announce a preferred fractional scale on a per-wl_surface basis. Qt forwards these Wayland events to an application using a usual DevicePixelRatioChange event. However, in contrast to the other platforms, this DevicePixelRatioChange event is issued directly on widgets and not screens. Additionally, the exact fractional scale is stored in QWindow object and not the current screen. Note that in theory it is possible to obtain per-screen fractional scaling on Wayland by interpolating data provided by wl_output and xdg_output events but qtwayland does not do that. If fractional-scale-v1 is not available, qtwayland will still fire per-Widget DevicePixelRatioChange events, but, obviously, with the per-screen possibly larger ceiled scaling. This whole thing makes handling DPI changes on Wayland really simple. All we need to do is to intercept DevicePixelRatioChange events firing on QWindow objects and call the old device_pixel_ratio_changed handler with the window's devicePixelRatio(). The only caveat here is not forget to always set QWidget's parent before calling devicePixelRatio() on it. |
||
---|---|---|
.. | ||
Android | ||
AppKit | ||
cmake | ||
Icons | ||
ImageDecoder | ||
Qt | ||
RequestServer | ||
SQLServer | ||
WebContent | ||
WebDriver | ||
WebSocket | ||
WebWorker | ||
.gitignore | ||
CMakeLists.txt | ||
FontPlugin.cpp | ||
FontPlugin.h | ||
HelperProcess.cpp | ||
HelperProcess.h | ||
ImageCodecPlugin.cpp | ||
ImageCodecPlugin.h | ||
Info.plist | ||
ladybird.nix | ||
README.md | ||
Types.h | ||
Utilities.cpp | ||
Utilities.h |
Ladybird
Ladybird is a web browser built on the LibWeb and LibJS engines from SerenityOS with a cross-platform GUI in Qt.
For more information about Ladybird, see this blog post.
See build instructions.