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.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c
index 1f70b193..a97ee8be 100644
--- a/sway/desktop/xdg_shell.c
+++ b/sway/desktop/xdg_shell.c
@@ -21,18 +21,15 @@
static const struct sway_view_child_impl popup_impl;
-static void popup_get_root_coords(struct sway_view_child *child,
- int *root_sx, int *root_sy) {
+static void popup_get_view_coords(struct sway_view_child *child,
+ int *sx, int *sy) {
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,
- x_offset + surface->popup->geometry.x,
- y_offset + surface->popup->geometry.y,
- root_sx, root_sy);
+ surface->popup->geometry.x - surface->geometry.x,
+ surface->popup->geometry.y - surface->geometry.y,
+ sx, sy);
}
static void popup_destroy(struct sway_view_child *child) {
@@ -47,7 +44,7 @@ static void popup_destroy(struct sway_view_child *child) {
}
static const struct sway_view_child_impl popup_impl = {
- .get_root_coords = popup_get_root_coords,
+ .get_view_coords = popup_get_view_coords,
.destroy = popup_destroy,
};