Merge pull request #2895 from RyanDwyer/fix-popup-damage

Fix popup damage issues when toplevel and/or popup uses geometry
This commit is contained in:
Drew DeVault 2018-10-20 15:38:25 +02:00 committed by GitHub
commit 64534d2fd1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 4 deletions

View file

@ -25,9 +25,12 @@ static void popup_get_root_coords(struct sway_view_child *child,
struct sway_xdg_popup *popup = (struct sway_xdg_popup *)child;
struct wlr_xdg_surface *surface = popup->wlr_xdg_surface;
int x_offset = -child->view->geometry.x - surface->geometry.x;
int y_offset = -child->view->geometry.y - surface->geometry.y;
wlr_xdg_popup_get_toplevel_coords(surface->popup,
-surface->geometry.x + surface->popup->geometry.x,
-surface->geometry.y + surface->popup->geometry.y,
x_offset + surface->popup->geometry.x,
y_offset + surface->popup->geometry.y,
root_sx, root_sy);
}

View file

@ -24,9 +24,12 @@ static void popup_get_root_coords(struct sway_view_child *child,
struct sway_xdg_popup_v6 *popup = (struct sway_xdg_popup_v6 *)child;
struct wlr_xdg_surface_v6 *surface = popup->wlr_xdg_surface_v6;
int x_offset = -child->view->geometry.x - surface->geometry.x;
int y_offset = -child->view->geometry.y - surface->geometry.y;
wlr_xdg_popup_v6_get_toplevel_coords(surface->popup,
-surface->geometry.x + surface->popup->geometry.x,
-surface->geometry.y + surface->popup->geometry.y,
x_offset + surface->popup->geometry.x,
y_offset + surface->popup->geometry.y,
root_sx, root_sy);
}