aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorvaxerski <[email protected]>2024-02-14 11:28:43 +0000
committervaxerski <[email protected]>2024-02-14 11:44:47 +0000
commit06087914807f88d2a9fc76c8108985f6327598de (patch)
treeca1acdc3ca72f5c03a21c823735605f72edd9444
parent2a002f31e4077ff6dd20a7116e372712e3b4e7f8 (diff)
downloadHyprland-06087914807f88d2a9fc76c8108985f6327598de.tar.gz
Hyprland-06087914807f88d2a9fc76c8108985f6327598de.zip
dwindle: round wbox before setting
-rw-r--r--src/layout/DwindleLayout.cpp15
1 files 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
+
+ PWINDOW->m_vRealSize = wb.size();
+ PWINDOW->m_vRealPosition = wb.pos();
- g_pXWaylandManager->setWindowSize(PWINDOW, calcSize);
+ 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);