diff options
-rw-r--r-- | sway/desktop/xdg_shell.c | 12 | ||||
-rw-r--r-- | sway/desktop/xdg_shell_v6.c | 12 |
2 files changed, 10 insertions, 14 deletions
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c index 9036448b..2e2815c1 100644 --- a/sway/desktop/xdg_shell.c +++ b/sway/desktop/xdg_shell.c | |||
@@ -24,13 +24,11 @@ static void popup_get_root_coords(struct sway_view_child *child, | |||
24 | int *root_sx, int *root_sy) { | 24 | int *root_sx, int *root_sy) { |
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 | *root_sx = -surface->geometry.x; | 27 | |
28 | *root_sy = -surface->geometry.y; | 28 | wlr_xdg_popup_get_toplevel_coords(surface->popup, |
29 | while (surface && surface->role == WLR_XDG_SURFACE_ROLE_POPUP) { | 29 | -surface->geometry.x + surface->popup->geometry.x, |
30 | *root_sx += surface->popup->geometry.x; | 30 | -surface->geometry.y + surface->popup->geometry.y, |
31 | *root_sy += surface->popup->geometry.y; | 31 | root_sx, root_sy); |
32 | surface = wlr_xdg_surface_from_wlr_surface(surface->popup->parent); | ||
33 | } | ||
34 | } | 32 | } |
35 | 33 | ||
36 | static void popup_destroy(struct sway_view_child *child) { | 34 | static void popup_destroy(struct sway_view_child *child) { |
diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c index 765a80b1..e61bd652 100644 --- a/sway/desktop/xdg_shell_v6.c +++ b/sway/desktop/xdg_shell_v6.c | |||
@@ -23,13 +23,11 @@ static void popup_get_root_coords(struct sway_view_child *child, | |||
23 | int *root_sx, int *root_sy) { | 23 | int *root_sx, int *root_sy) { |
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 | *root_sx = -surface->geometry.x; | 26 | |
27 | *root_sy = -surface->geometry.y; | 27 | wlr_xdg_popup_v6_get_toplevel_coords(surface->popup, |
28 | while (surface && surface->role == WLR_XDG_SURFACE_V6_ROLE_POPUP) { | 28 | -surface->geometry.x + surface->popup->geometry.x, |
29 | *root_sx += surface->popup->geometry.x; | 29 | -surface->geometry.y + surface->popup->geometry.y, |
30 | *root_sy += surface->popup->geometry.y; | 30 | root_sx, root_sy); |
31 | surface = surface->popup->parent; | ||
32 | } | ||
33 | } | 31 | } |
34 | 32 | ||
35 | static void popup_destroy(struct sway_view_child *child) { | 33 | static void popup_destroy(struct sway_view_child *child) { |