aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/xdg_shell.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.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.c')
-rw-r--r--sway/desktop/xdg_shell.c12
1 files changed, 5 insertions, 7 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
36static void popup_destroy(struct sway_view_child *child) { 34static void popup_destroy(struct sway_view_child *child) {