diff options
-rw-r--r-- | sway/desktop/xdg_shell.c | 7 | ||||
-rw-r--r-- | sway/desktop/xdg_shell_v6.c | 7 |
2 files changed, 10 insertions, 4 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, | |||
25 | struct sway_xdg_popup *popup = (struct sway_xdg_popup *)child; | 25 | struct sway_xdg_popup *popup = (struct sway_xdg_popup *)child; |
26 | struct wlr_xdg_surface *surface = popup->wlr_xdg_surface; | 26 | struct wlr_xdg_surface *surface = popup->wlr_xdg_surface; |
27 | 27 | ||
28 | int x_offset = -child->view->geometry.x - surface->geometry.x; | ||
29 | int y_offset = -child->view->geometry.y - surface->geometry.y; | ||
30 | |||
28 | wlr_xdg_popup_get_toplevel_coords(surface->popup, | 31 | wlr_xdg_popup_get_toplevel_coords(surface->popup, |
29 | -surface->geometry.x + surface->popup->geometry.x, | 32 | x_offset + surface->popup->geometry.x, |
30 | -surface->geometry.y + surface->popup->geometry.y, | 33 | y_offset + surface->popup->geometry.y, |
31 | root_sx, root_sy); | 34 | root_sx, root_sy); |
32 | } | 35 | } |
33 | 36 | ||
diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c index eb8ba853..7159f1ed 100644 --- a/sway/desktop/xdg_shell_v6.c +++ b/sway/desktop/xdg_shell_v6.c | |||
@@ -24,9 +24,12 @@ static void popup_get_root_coords(struct sway_view_child *child, | |||
24 | struct sway_xdg_popup_v6 *popup = (struct sway_xdg_popup_v6 *)child; | 24 | struct sway_xdg_popup_v6 *popup = (struct sway_xdg_popup_v6 *)child; |
25 | struct wlr_xdg_surface_v6 *surface = popup->wlr_xdg_surface_v6; | 25 | struct wlr_xdg_surface_v6 *surface = popup->wlr_xdg_surface_v6; |
26 | 26 | ||
27 | int x_offset = -child->view->geometry.x - surface->geometry.x; | ||
28 | int y_offset = -child->view->geometry.y - surface->geometry.y; | ||
29 | |||
27 | wlr_xdg_popup_v6_get_toplevel_coords(surface->popup, | 30 | wlr_xdg_popup_v6_get_toplevel_coords(surface->popup, |
28 | -surface->geometry.x + surface->popup->geometry.x, | 31 | x_offset + surface->popup->geometry.x, |
29 | -surface->geometry.y + surface->popup->geometry.y, | 32 | y_offset + surface->popup->geometry.y, |
30 | root_sx, root_sy); | 33 | root_sx, root_sy); |
31 | } | 34 | } |
32 | 35 | ||