aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorVaxry <[email protected]>2024-06-07 20:23:35 +0200
committerVaxry <[email protected]>2024-06-07 20:24:09 +0200
commitc31d9ef4172452f6f219f91d9b87a24d91f0cf3a (patch)
treebaadb5772bb93bb4185ebed482c12f54cdcda3a4
parent6b6b02c27a21a6a4fe3d66937c709c32e21a9078 (diff)
downloadHyprland-c31d9ef4172452f6f219f91d9b87a24d91f0cf3a.tar.gz
Hyprland-c31d9ef4172452f6f219f91d9b87a24d91f0cf3a.zip
xdg_shell: fix nested xdg_positioner calculations
ref #6240
-rw-r--r--src/protocols/XDGShell.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/protocols/XDGShell.cpp b/src/protocols/XDGShell.cpp
index 23148fab..80e3487d 100644
--- a/src/protocols/XDGShell.cpp
+++ b/src/protocols/XDGShell.cpp
@@ -528,7 +528,7 @@ CBox CXDGPositionerRules::getPosition(const CBox& constraint, const Vector2D& pa
bool success = predictedBox.inside(constraint);
if (success)
- return predictedBox;
+ return predictedBox.translate(-parentCoord - constraint.pos());
if (state.constraintAdjustment & (XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_FLIP_X | XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_FLIP_Y)) {
// attempt to flip
@@ -547,7 +547,7 @@ CBox CXDGPositionerRules::getPosition(const CBox& constraint, const Vector2D& pa
success = false;
if (success)
- return test;
+ return test.translate(-parentCoord - constraint.pos());
}
// if flips fail, we will slide and remember.
@@ -584,7 +584,7 @@ CBox CXDGPositionerRules::getPosition(const CBox& constraint, const Vector2D& pa
success = test.copy().expand(-1).inside(constraint);
if (success)
- return test;
+ return test.translate(-parentCoord - constraint.pos());
}
if (state.constraintAdjustment & (XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_RESIZE_X | XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_RESIZE_Y)) {
@@ -613,7 +613,7 @@ CBox CXDGPositionerRules::getPosition(const CBox& constraint, const Vector2D& pa
success = test.copy().expand(-1).inside(constraint);
if (success)
- return test;
+ return test.translate(-parentCoord - constraint.pos());
}
LOGM(WARN, "Compositor/client bug: xdg_positioner couldn't find a place");