diff --git a/src/qwaylandlayersurface.cpp b/src/qwaylandlayersurface.cpp index 95ae6bf..79f57c8 100644 --- a/src/qwaylandlayersurface.cpp +++ b/src/qwaylandlayersurface.cpp @@ -125,6 +125,12 @@ void QWaylandLayerSurface::applyConfigure() void QWaylandLayerSurface::setDesiredSize(const QSize &size) { + // This guards setDesiredSize to avoid the connection between + // m_interface::desiredSizeChanged and this takes effect when + // we call m_interface->setDesiredSize from here + m_settingDesiredSize = true; + m_interface->setDesiredSize(size); + const bool horizontallyConstrained = m_interface->anchors().testFlags({Window::AnchorLeft, Window::AnchorRight}); const bool verticallyConstrained = m_interface->anchors().testFlags({Window::AnchorTop, Window::AnchorBottom}); @@ -136,6 +142,7 @@ void QWaylandLayerSurface::setDesiredSize(const QSize &size) effectiveSize.setHeight(0); } set_size(effectiveSize.width(), effectiveSize.height()); + m_settingDesiredSize = false; } void QWaylandLayerSurface::setAnchor(uint anchor) diff --git a/src/qwaylandlayersurface_p.h b/src/qwaylandlayersurface_p.h index 079a295..5152146 100644 --- a/src/qwaylandlayersurface_p.h +++ b/src/qwaylandlayersurface_p.h @@ -64,6 +64,7 @@ private: QSize m_pendingSize; QString m_activationToken; + bool m_settingDesiredSize = false; bool m_configured = false; #if QT_VERSION < QT_VERSION_CHECK(6, 9, 0) bool m_configuring = false;