ladybird/Ladybird/Qt
Dan Klishch 38164411f0 Ladybird/Qt: Properly listen for DPI changes on Wayland
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.
2024-02-06 09:59:17 -07:00
..
AudioCodecPluginQt.cpp Ladybird: Move Qt-specific classes and functions to a Qt subdirectory 2023-08-07 14:58:04 -06:00
AudioCodecPluginQt.h Ladybird: Move Qt-specific classes and functions to a Qt subdirectory 2023-08-07 14:58:04 -06:00
AudioThread.cpp Ladybird: Move Qt-specific classes and functions to a Qt subdirectory 2023-08-07 14:58:04 -06:00
AudioThread.h Ladybird: Move Qt-specific classes and functions to a Qt subdirectory 2023-08-07 14:58:04 -06:00
AutoComplete.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
AutoComplete.h Ladybird/Qt: Make String allocation infallible 2023-12-04 12:03:48 -07:00
BrowserWindow.cpp Ladybird/Qt: Properly listen for DPI changes on Wayland 2024-02-06 09:59:17 -07:00
BrowserWindow.h Ladybird/Qt: Properly listen for DPI changes on Wayland 2024-02-06 09:59:17 -07:00
EventLoopImplementationQt.cpp LibCore: Allow listening for multiple conditions using a single Notifier 2024-02-03 16:43:13 -07:00
EventLoopImplementationQt.h Ladybird: Move Qt-specific classes and functions to a Qt subdirectory 2023-08-07 14:58:04 -06:00
EventLoopImplementationQtEventTarget.cpp Ladybird: Move Qt-specific classes and functions to a Qt subdirectory 2023-08-07 14:58:04 -06:00
EventLoopImplementationQtEventTarget.h Ladybird: Move Qt-specific classes and functions to a Qt subdirectory 2023-08-07 14:58:04 -06:00
Icon.cpp Ladybird: Load all icons uses Core::Resource URIs 2023-11-06 09:39:59 +01:00
Icon.h Ladybird: Load all icons uses Core::Resource URIs 2023-11-06 09:39:59 +01:00
InspectorWidget.cpp Ladybird/Qt: Properly listen for DPI changes on Wayland 2024-02-06 09:59:17 -07:00
InspectorWidget.h Ladybird/Qt: Properly listen for DPI changes on Wayland 2024-02-06 09:59:17 -07:00
ladybird.qrc Ladybird: Move Qt-specific classes and functions to a Qt subdirectory 2023-08-07 14:58:04 -06:00
LocationEdit.cpp Ladybird/Qt: Make String allocation infallible 2023-12-04 12:03:48 -07:00
LocationEdit.h Ladybird: Add autocomplete to LocationEdit 2023-08-17 15:30:23 +01:00
main.cpp Ladybird+WebContent: Add chrome command line and exe path passing 2024-01-17 17:32:05 +01:00
RequestManagerQt.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
RequestManagerQt.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
Settings.cpp Ladybird+BrowserSettings: Load the NTP/home resource files with LibWeb 2023-12-24 14:09:23 +01:00
Settings.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
SettingsDialog.cpp Ladybird/Qt: Do not "share" ownership of Qt objects 2023-12-04 12:03:48 -07:00
SettingsDialog.h Ladybird/Qt: Do not "share" ownership of Qt objects 2023-12-04 12:03:48 -07:00
StringUtils.cpp Ladybird/Qt: Rename new_tab to new_tab_from_url and make it take AK::URL 2024-02-03 20:51:37 -05:00
StringUtils.h Ladybird/Qt: Rename new_tab to new_tab_from_url and make it take AK::URL 2024-02-03 20:51:37 -05:00
Tab.cpp Ladybird/Qt: Properly listen for DPI changes on Wayland 2024-02-06 09:59:17 -07:00
Tab.h Ladybird/Qt: Rename new_tab to new_tab_from_url and make it take AK::URL 2024-02-03 20:51:37 -05:00
TVGIconEngine.cpp Ladybird: Move Qt-specific classes and functions to a Qt subdirectory 2023-08-07 14:58:04 -06:00
TVGIconEngine.h Ladybird: Move Qt-specific classes and functions to a Qt subdirectory 2023-08-07 14:58:04 -06:00
WebContentView.cpp Ladybird/Qt: Properly listen for DPI changes on Wayland 2024-02-06 09:59:17 -07:00
WebContentView.h Ladybird/Qt: Properly listen for DPI changes on Wayland 2024-02-06 09:59:17 -07:00
WebSocketClientManagerQt.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
WebSocketClientManagerQt.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
WebSocketImplQt.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
WebSocketImplQt.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
WebSocketQt.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
WebSocketQt.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30