aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop/xdg_shell.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/desktop/xdg_shell.c')
-rw-r--r--sway/desktop/xdg_shell.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c
index 1ed45a6b..fda1bdef 100644
--- a/sway/desktop/xdg_shell.c
+++ b/sway/desktop/xdg_shell.c
@@ -25,9 +25,12 @@ static void popup_get_root_coords(struct sway_view_child *child,
struct sway_xdg_popup *popup = (struct sway_xdg_popup *)child;
struct wlr_xdg_surface *surface = popup->wlr_xdg_surface;
+ int x_offset = -child->view->geometry.x - surface->geometry.x;
+ int y_offset = -child->view->geometry.y - surface->geometry.y;
+
wlr_xdg_popup_get_toplevel_coords(surface->popup,
- -surface->geometry.x + surface->popup->geometry.x,
- -surface->geometry.y + surface->popup->geometry.y,
+ x_offset + surface->popup->geometry.x,
+ y_offset + surface->popup->geometry.y,
root_sx, root_sy);
}