From 23d3fc712cdf7fc0a4ff837082de9ba773e8605c Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Wed, 23 Mar 2022 15:35:50 +0000 Subject: Implement fractional_scale_v1 and wp_viewport This allows compositors to hint a non-integer scale to use on a window which we can hook to Qt's existing fractional scaling support. The viewport is used to communicate the relationship between buffer size and logical size to the compositor. It is a non-integer alternative to wl_buffer_scale Change-Id: I1a850f1bcd40e8d04e241e18a538b11f18bc671c Reviewed-by: Qt CI Bot Reviewed-by: David Edmundson --- src/client/qwaylanddisplay_p.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/client/qwaylanddisplay_p.h') diff --git a/src/client/qwaylanddisplay_p.h b/src/client/qwaylanddisplay_p.h index 473016f1e..640f33b8e 100644 --- a/src/client/qwaylanddisplay_p.h +++ b/src/client/qwaylanddisplay_p.h @@ -36,6 +36,7 @@ #endif struct wl_cursor_image; +struct wp_viewport; QT_BEGIN_NAMESPACE @@ -50,6 +51,8 @@ namespace QtWayland { class zwp_text_input_manager_v2; class zwp_text_input_manager_v4; class qt_text_input_method_manager_v1; + class wp_viewporter; + class wp_fractional_scale_manager_v1; } namespace QtWaylandClient { @@ -110,6 +113,7 @@ public: struct wl_surface *createSurface(void *handle); struct ::wl_region *createRegion(const QRegion &qregion); struct ::wl_subsurface *createSubSurface(QWaylandWindow *window, QWaylandWindow *parent); + struct ::wp_viewport *createViewport(QWaylandWindow *window); QWaylandShellIntegration *shellIntegration() const; QWaylandClientBufferIntegration *clientBufferIntegration() const; @@ -146,6 +150,8 @@ public: QtWayland::zwp_text_input_manager_v4 *textInputManagerv4() const { return mTextInputManagerv4.data(); } QWaylandHardwareIntegration *hardwareIntegration() const { return mHardwareIntegration.data(); } QWaylandXdgOutputManagerV1 *xdgOutputManager() const { return mXdgOutputManager.data(); } + QtWayland::wp_fractional_scale_manager_v1 *fractionalScaleManager() const { return mFractionalScaleManager.data(); } + QtWayland::wp_viewporter *viewporter() const { return mViewporter.data(); } struct RegistryGlobal { uint32_t id; @@ -265,6 +271,8 @@ private: QScopedPointer mTextInputManagerv4; QScopedPointer mHardwareIntegration; QScopedPointer mXdgOutputManager; + QScopedPointer mViewporter; + QScopedPointer mFractionalScaleManager; int mFd = -1; int mWritableNotificationFd = -1; QList mGlobals; -- cgit v1.2.3