diff options
author | Tony Crisci <tony@dubstepdish.com> | 2018-03-28 12:46:41 -0400 |
---|---|---|
committer | Tony Crisci <tony@dubstepdish.com> | 2018-03-28 12:46:41 -0400 |
commit | c5cd8050986ad71e954e054445c42120e5868700 (patch) | |
tree | c4965c82e1669fffdf693a68ef1ba338ca612de7 /rootston | |
parent | e2c4e1ef541f825eeb804d0873d305213c3fbb82 (diff) |
positioner rootston cleanup and bugfix
Diffstat (limited to 'rootston')
-rw-r--r-- | rootston/xdg_shell_v6.c | 8 |
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; } |