From 06087914807f88d2a9fc76c8108985f6327598de Mon Sep 17 00:00:00 2001 From: vaxerski Date: Wed, 14 Feb 2024 11:28:43 +0000 Subject: [PATCH] dwindle: round wbox before setting --- src/layout/DwindleLayout.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp index 819d7b3e..11be13ae 100644 --- a/src/layout/DwindleLayout.cpp +++ b/src/layout/DwindleLayout.cpp @@ -226,10 +226,13 @@ void CHyprDwindleLayout::applyNodeDataToWindow(SDwindleNodeData* pNode, bool for g_pXWaylandManager->setWindowSize(PWINDOW, wb.size()); } else { - PWINDOW->m_vRealSize = calcSize; - PWINDOW->m_vRealPosition = calcPos; + CBox wb = {calcPos, calcSize}; + wb.round(); // avoid rounding mess - g_pXWaylandManager->setWindowSize(PWINDOW, calcSize); + PWINDOW->m_vRealSize = wb.size(); + PWINDOW->m_vRealPosition = wb.pos(); + + g_pXWaylandManager->setWindowSize(PWINDOW, wb.size()); } if (force) { @@ -645,8 +648,10 @@ void CHyprDwindleLayout::resizeActiveWindow(const Vector2D& pixResize, eRectCorn else PWINDOW->m_vPseudoSize.y -= pixResize.y * 2; - PWINDOW->m_vPseudoSize.x = std::clamp(PWINDOW->m_vPseudoSize.x, 30.0, PNODE->box.w); - PWINDOW->m_vPseudoSize.y = std::clamp(PWINDOW->m_vPseudoSize.y, 30.0, PNODE->box.h); + CBox wbox = PNODE->box; + wbox.round(); + + PWINDOW->m_vPseudoSize = {std::clamp(PWINDOW->m_vPseudoSize.x, 30.0, wbox.w), std::clamp(PWINDOW->m_vPseudoSize.y, 30.0, wbox.h)}; PWINDOW->m_vLastFloatingSize = PWINDOW->m_vPseudoSize; PNODE->recalcSizePosRecursive(*PANIMATE == 0);