From 826b9362c99c2fb55c3c91331938eed4998f4045 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 30 Apr 2025 10:06:29 +0200 Subject: [PATCH] don't always gto trough m_interface --- src/qwaylandlayersurface.cpp | 11 ++++------- src/qwaylandlayersurface_p.h | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/qwaylandlayersurface.cpp b/src/qwaylandlayersurface.cpp index 170482e..95ae6bf 100644 --- a/src/qwaylandlayersurface.cpp +++ b/src/qwaylandlayersurface.cpp @@ -44,7 +44,7 @@ QWaylandLayerSurface::QWaylandLayerSurface(QWaylandLayerShellIntegration *shell, setAnchor(m_interface->anchors()); connect(m_interface, &Window::anchorsChanged, this, [this]() { setAnchor(m_interface->anchors()); - m_interface->setDesiredSize(m_window->windowContentGeometry().size()); + setDesiredSize(m_window->windowContentGeometry().size()); }); setExclusiveZone(m_interface->exclusionZone()); @@ -61,7 +61,6 @@ QWaylandLayerSurface::QWaylandLayerSurface(QWaylandLayerShellIntegration *shell, setMargins(m_interface->margins()); }); - // setDesiredSize is called only by this connection, everywhere else we use m_interface->setDesiredSize() connect(m_interface, &Window::desiredSizeChanged, this, [this]() { setDesiredSize(m_interface->desiredSize()); }); @@ -71,7 +70,7 @@ QWaylandLayerSurface::QWaylandLayerSurface(QWaylandLayerShellIntegration *shell, setKeyboardInteractivity(m_interface->keyboardInteractivity()); }); - m_interface->setDesiredSize(window->windowContentGeometry().size()); + setDesiredSize(window->windowContentGeometry().size()); } QWaylandLayerSurface::~QWaylandLayerSurface() @@ -137,8 +136,6 @@ void QWaylandLayerSurface::setDesiredSize(const QSize &size) effectiveSize.setHeight(0); } set_size(effectiveSize.width(), effectiveSize.height()); - - m_window->window()->requestUpdate(); } void QWaylandLayerSurface::setAnchor(uint anchor) @@ -181,12 +178,12 @@ void QWaylandLayerSurface::setWindowGeometry(const QRect &geometry) return; } - m_interface->setDesiredSize(geometry.size()); + setDesiredSize(geometry.size()); } #else void QWaylandLayerSurface::setWindowSize(const QSize &size) { - m_interface->setDesiredSize(size); + setDesiredSize(size); } #endif diff --git a/src/qwaylandlayersurface_p.h b/src/qwaylandlayersurface_p.h index cd9bb03..079a295 100644 --- a/src/qwaylandlayersurface_p.h +++ b/src/qwaylandlayersurface_p.h @@ -34,6 +34,7 @@ public: } void attachPopup(QtWaylandClient::QWaylandShellSurface *popup) override; + void setDesiredSize(const QSize &size); void setAnchor(uint32_t anchor); void setExclusiveZone(int32_t zone); void setExclusiveEdge(uint32_t edge); @@ -53,7 +54,6 @@ public: void requestXdgActivationToken(quint32 serial) override; private: - void setDesiredSize(const QSize &size); void sendExpose(); void zwlr_layer_surface_v1_configure(uint32_t serial, uint32_t width, uint32_t height) override; void zwlr_layer_surface_v1_closed() override;