Skip to content

Commit

Permalink
xdg_shell: improve xdg_positioner slide behavior
Browse files Browse the repository at this point in the history
ref #6240
  • Loading branch information
vaxerski committed Jun 7, 2024
1 parent d633714 commit a0409fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/protocols/XDGShell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.y = 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);

Expand Down

0 comments on commit a0409fe

Please sign in to comment.