From 2d65b01d877ae481b50a1d6fafc90bb4e08da0ed Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Wed, 29 May 2024 15:25:11 +0300 Subject: [PATCH] Port to QWaylandShellSurface::setWindowSize() --- src/qwaylandlayersurface.cpp | 11 +++++++++++ src/qwaylandlayersurface_p.h | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/src/qwaylandlayersurface.cpp b/src/qwaylandlayersurface.cpp index 16bc12e..4bc6e3f 100644 --- a/src/qwaylandlayersurface.cpp +++ b/src/qwaylandlayersurface.cpp @@ -110,9 +110,13 @@ void QWaylandLayerSurface::attachPopup(QtWaylandClient::QWaylandShellSurface *po void QWaylandLayerSurface::applyConfigure() { +#if QT_VERSION < QT_VERSION_CHECK(6, 8, 0) m_configuring = true; +#endif window()->resizeFromApplyConfigure(m_pendingSize); +#if QT_VERSION < QT_VERSION_CHECK(6, 8, 0) m_configuring = false; +#endif } void QWaylandLayerSurface::setDesiredSize(const QSize &size) @@ -163,6 +167,7 @@ void QWaylandLayerSurface::setLayer(uint32_t layer) set_layer(layer); } +#if QT_VERSION < QT_VERSION_CHECK(6, 8, 0) void QWaylandLayerSurface::setWindowGeometry(const QRect &geometry) { if (m_configuring) { @@ -171,6 +176,12 @@ void QWaylandLayerSurface::setWindowGeometry(const QRect &geometry) setDesiredSize(geometry.size()); } +#else +void QWaylandLayerSurface::setWindowSize(const QSize &size) +{ + setDesiredSize(size); +} +#endif bool QWaylandLayerSurface::requestActivate() { diff --git a/src/qwaylandlayersurface_p.h b/src/qwaylandlayersurface_p.h index a829acd..a8b6e2b 100644 --- a/src/qwaylandlayersurface_p.h +++ b/src/qwaylandlayersurface_p.h @@ -43,7 +43,11 @@ public: void setLayer(uint32_t layer); void applyConfigure() override; +#if QT_VERSION < QT_VERSION_CHECK(6, 8, 0) void setWindowGeometry(const QRect &geometry) override; +#else + void setWindowSize(const QSize &size) override; +#endif bool requestActivate() override; void setXdgActivationToken(const QString &token) override; @@ -61,7 +65,9 @@ private: QString m_activationToken; bool m_configured = false; +#if QT_VERSION < QT_VERSION_CHECK(6, 8, 0) bool m_configuring = false; +#endif }; }