dwindle: round wbox before setting

This commit is contained in:
Vaxry 2024-02-14 11:28:43 +00:00
parent 2a002f31e4
commit 0608791480

View file

@ -226,10 +226,13 @@ void CHyprDwindleLayout::applyNodeDataToWindow(SDwindleNodeData* pNode, bool for
g_pXWaylandManager->setWindowSize(PWINDOW, wb.size()); g_pXWaylandManager->setWindowSize(PWINDOW, wb.size());
} else { } else {
PWINDOW->m_vRealSize = calcSize; CBox wb = {calcPos, calcSize};
PWINDOW->m_vRealPosition = calcPos; 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) { if (force) {
@ -645,8 +648,10 @@ void CHyprDwindleLayout::resizeActiveWindow(const Vector2D& pixResize, eRectCorn
else else
PWINDOW->m_vPseudoSize.y -= pixResize.y * 2; PWINDOW->m_vPseudoSize.y -= pixResize.y * 2;
PWINDOW->m_vPseudoSize.x = std::clamp(PWINDOW->m_vPseudoSize.x, 30.0, PNODE->box.w); CBox wbox = PNODE->box;
PWINDOW->m_vPseudoSize.y = std::clamp(PWINDOW->m_vPseudoSize.y, 30.0, PNODE->box.h); 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; PWINDOW->m_vLastFloatingSize = PWINDOW->m_vPseudoSize;
PNODE->recalcSizePosRecursive(*PANIMATE == 0); PNODE->recalcSizePosRecursive(*PANIMATE == 0);