diff options
Diffstat (limited to 'sway/desktop/xdg_shell.c')
-rw-r--r-- | sway/desktop/xdg_shell.c | 15 |
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 @@ | |||
21 | 21 | ||
22 | static const struct sway_view_child_impl popup_impl; | 22 | static const struct sway_view_child_impl popup_impl; |
23 | 23 | ||
24 | static void popup_get_root_coords(struct sway_view_child *child, | 24 | static void popup_get_view_coords(struct sway_view_child *child, |
25 | int *root_sx, int *root_sy) { | 25 | int *sx, int *sy) { |
26 | struct sway_xdg_popup *popup = (struct sway_xdg_popup *)child; | 26 | struct sway_xdg_popup *popup = (struct sway_xdg_popup *)child; |
27 | struct wlr_xdg_surface *surface = popup->wlr_xdg_surface; | 27 | struct wlr_xdg_surface *surface = popup->wlr_xdg_surface; |
28 | 28 | ||
29 | int x_offset = -child->view->geometry.x - surface->geometry.x; | ||
30 | int y_offset = -child->view->geometry.y - surface->geometry.y; | ||
31 | |||
32 | wlr_xdg_popup_get_toplevel_coords(surface->popup, | 29 | wlr_xdg_popup_get_toplevel_coords(surface->popup, |
33 | x_offset + surface->popup->geometry.x, | 30 | surface->popup->geometry.x - surface->geometry.x, |
34 | y_offset + surface->popup->geometry.y, | 31 | surface->popup->geometry.y - surface->geometry.y, |
35 | root_sx, root_sy); | 32 | sx, sy); |
36 | } | 33 | } |
37 | 34 | ||
38 | static void popup_destroy(struct sway_view_child *child) { | 35 | static void popup_destroy(struct sway_view_child *child) { |
@@ -47,7 +44,7 @@ static void popup_destroy(struct sway_view_child *child) { | |||
47 | } | 44 | } |
48 | 45 | ||
49 | static const struct sway_view_child_impl popup_impl = { | 46 | static const struct sway_view_child_impl popup_impl = { |
50 | .get_root_coords = popup_get_root_coords, | 47 | .get_view_coords = popup_get_view_coords, |
51 | .destroy = popup_destroy, | 48 | .destroy = popup_destroy, |
52 | }; | 49 | }; |
53 | 50 | ||