aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/layout/DwindleLayout.cpp
diff options
context:
space:
mode:
authorVaxry <[email protected]>2024-02-02 15:04:04 +0000
committerVaxry <[email protected]>2024-02-02 15:04:04 +0000
commit341e04a36ce5254315a40c563ea7f5d891b289e8 (patch)
treed17fa343d46765b707d692aa2822904b662577f3 /src/layout/DwindleLayout.cpp
parentd7514412d8bd143858c53d87fe0d7108f9171cff (diff)
downloadHyprland-341e04a36ce5254315a40c563ea7f5d891b289e8.tar.gz
Hyprland-341e04a36ce5254315a40c563ea7f5d891b289e8.zip
dwindle: avoid sending negative sizes to wlr
fixes #4591
Diffstat (limited to 'src/layout/DwindleLayout.cpp')
-rw-r--r--src/layout/DwindleLayout.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp
index 85111fcd..4058121f 100644
--- a/src/layout/DwindleLayout.cpp
+++ b/src/layout/DwindleLayout.cpp
@@ -22,13 +22,13 @@ void SDwindleNodeData::recalcSizePosRecursive(bool force, bool horizontalOverrid
if (SPLITSIDE) {
// split left/right
const float FIRSTSIZE = box.w / 2.0 * splitRatio;
- children[0]->box = CBox{box.x, box.y, FIRSTSIZE, box.h};
- children[1]->box = CBox{box.x + FIRSTSIZE, box.y, box.w - FIRSTSIZE, box.h};
+ children[0]->box = CBox{box.x, box.y, FIRSTSIZE, box.h}.noNegativeSize();
+ children[1]->box = CBox{box.x + FIRSTSIZE, box.y, box.w - FIRSTSIZE, box.h}.noNegativeSize();
} else {
// split top/bottom
const float FIRSTSIZE = box.h / 2.0 * splitRatio;
- children[0]->box = CBox{box.x, box.y, box.w, FIRSTSIZE};
- children[1]->box = CBox{box.x, box.y + FIRSTSIZE, box.w, box.h - FIRSTSIZE};
+ children[0]->box = CBox{box.x, box.y, box.w, FIRSTSIZE}.noNegativeSize();
+ children[1]->box = CBox{box.x, box.y + FIRSTSIZE, box.w, box.h - FIRSTSIZE}.noNegativeSize();
}
children[0]->recalcSizePosRecursive(force);