From e3098a660a287021fb343ee4f237a67aac9de660 Mon Sep 17 00:00:00 2001 From: David Redondo Date: Thu, 21 Dec 2023 13:58:24 +0000 Subject: [PATCH] Fix constrained check The value in parantheses was always zero. --- src/qwaylandlayersurface.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/qwaylandlayersurface.cpp b/src/qwaylandlayersurface.cpp index 520aa2d..89f47ef 100644 --- a/src/qwaylandlayersurface.cpp +++ b/src/qwaylandlayersurface.cpp @@ -119,6 +119,7 @@ void QWaylandLayerSurface::applyConfigure() void QWaylandLayerSurface::setAnchor(uint anchor) { set_anchor(anchor); + setWindowGeometry(window()->windowContentGeometry()); } void QWaylandLayerSurface::setExclusiveZone(int32_t zone) @@ -144,8 +145,8 @@ void QWaylandLayerSurface::setLayer(uint32_t layer) void QWaylandLayerSurface::setWindowGeometry(const QRect &geometry) { - const bool horizontallyConstrained = m_interface->anchors() & (Window::AnchorLeft & Window::AnchorRight); - const bool verticallyConstrained = m_interface->anchors() & (Window::AnchorTop & Window::AnchorBottom); + const bool horizontallyConstrained = m_interface->anchors().testFlags({Window::AnchorLeft, Window::AnchorRight}); + const bool verticallyConstrained = m_interface->anchors().testFlags({Window::AnchorTop, Window::AnchorBottom}); QSize size = geometry.size(); if (horizontallyConstrained) {