aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/xdg_shell_v6.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-10-06 17:29:23 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-10-07 11:07:29 +1000
commit59ba528bd930e55263cbee03eb9dfb6bdee98caa (patch)
tree0efb1ca4ad5f610dcbffab4fe12fe493f21e16ab /sway/desktop/xdg_shell_v6.c
parentOnly damage popups when popups have damage (diff)
downloadsway-59ba528bd930e55263cbee03eb9dfb6bdee98caa.tar.gz
sway-59ba528bd930e55263cbee03eb9dfb6bdee98caa.tar.zst
sway-59ba528bd930e55263cbee03eb9dfb6bdee98caa.zip
Use wlr_xdg_popup_get_toplevel_coords
Diffstat (limited to 'sway/desktop/xdg_shell_v6.c')
-rw-r--r--sway/desktop/xdg_shell_v6.c12
1 files changed, 5 insertions, 7 deletions
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
35static void popup_destroy(struct sway_view_child *child) { 33static void popup_destroy(struct sway_view_child *child) {