diff options
| author | Vaxry <vaxry@vaxry.net> | 2024-06-07 19:46:24 +0200 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2024-06-07 19:46:51 +0200 |
| commit | 9bc00897fcc896c49a83f55da9de2427e878401a (patch) | |
| tree | 7e0f512273674ac81a17c720c57bb3c35f28d032 /src/protocols/XDGShell.cpp | |
| parent | d6337146bb99a20c96c89b7693f4ad726455f6ba (diff) | |
xdg_shell: improve xdg_positioner slide behavior
ref #6240
Diffstat (limited to 'src/protocols/XDGShell.cpp')
| -rw-r--r-- | src/protocols/XDGShell.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/protocols/XDGShell.cpp b/src/protocols/XDGShell.cpp index b192b43c..23148fab 100644 --- a/src/protocols/XDGShell.cpp +++ b/src/protocols/XDGShell.cpp @@ -575,11 +575,11 @@ CBox CXDGPositionerRules::getPosition(const CBox& constraint, const Vector2D& pa if (leftEdgeOut && slideX) test.x = constraint.x + EDGE_PADDING; if (rightEdgeOut && slideX) - test.x = constraint.x + constraint.w - predictedBox.w - EDGE_PADDING; + test.x = std::clamp((double)(constraint.x + constraint.w - test.w), (double)(constraint.x + EDGE_PADDING), (double)INFINITY); if (topEdgeOut && slideY) test.y = constraint.y + EDGE_PADDING; if (bottomEdgeOut && slideY) - test.y = constraint.y + constraint.h - predictedBox.y - EDGE_PADDING; + test.y = std::clamp((double)(constraint.y + constraint.h - test.h), (double)(constraint.y + EDGE_PADDING), (double)INFINITY); success = test.copy().expand(-1).inside(constraint); |
