guard setDesiredSize with a bool

This commit is contained in:
Marco Martin 2025-04-30 10:21:54 +02:00
parent 826b9362c9
commit 903564df06
2 changed files with 8 additions and 0 deletions

View File

@ -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)

View File

@ -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;