From c5cd8050986ad71e954e054445c42120e5868700 Mon Sep 17 00:00:00 2001 From: Tony Crisci Date: Wed, 28 Mar 2018 12:46:41 -0400 Subject: [PATCH] positioner rootston cleanup and bugfix --- rootston/xdg_shell_v6.c | 8 +++----- 1 file 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; }