aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rootston/xdg_shell_v6.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/rootston/xdg_shell_v6.c b/rootston/xdg_shell_v6.c
index 1e85a933..9bcdb4c9 100644
--- a/rootston/xdg_shell_v6.c
+++ b/rootston/xdg_shell_v6.c
@@ -97,19 +97,16 @@ static void popup_constraint_offset(struct roots_xdg_popup_v6 *popup,
*offset_x = *offset_y = 0;
- double popup_ox = popup_lx - output_box->x;
- double popup_oy = popup_ly - output_box->y;
-
if (popup_lx < output_box->x) {
*offset_x = output_box->x - popup_lx;
} else if (popup_lx + popup_width > output_box->x + output_box->width) {
- *offset_x = popup_width - (output_box->width - popup_ox);
+ *offset_x = output_box->x + output_box->width - (popup_lx + popup_width);
}
if (popup_ly < output_box->y) {
*offset_y = output_box->y - popup_ly;
} else if (popup_ly + popup_height > output_box->y + output_box->height) {
- *offset_y = popup_height - (output_box->height - popup_oy);
+ *offset_y = output_box->y + output_box->height - (popup_ly + popup_height);
}
}
@@ -163,6 +160,7 @@ static bool popup_unconstrain_slide(struct roots_xdg_popup_v6 *popup) {
if (offset_x) {
popup->wlr_popup->geometry.x += offset_x;
}
+
if (offset_y) {
popup->wlr_popup->geometry.y += offset_y;
}