Add assertion in container_at_view

This commit is contained in:
Ryan Dwyer 2018-05-20 08:34:43 +10:00
parent c08f9bf257
commit bd79584f65

View file

@ -455,6 +455,9 @@ struct sway_container *container_parent(struct sway_container *container,
static struct sway_container *container_at_view(struct sway_container *swayc, static struct sway_container *container_at_view(struct sway_container *swayc,
double ox, double oy, double ox, double oy,
struct wlr_surface **surface, double *sx, double *sy) { struct wlr_surface **surface, double *sx, double *sy) {
if (!sway_assert(swayc->type == C_VIEW, "Expected a view")) {
return NULL;
}
struct sway_view *sview = swayc->sway_view; struct sway_view *sview = swayc->sway_view;
double view_sx = ox - sview->x; double view_sx = ox - sview->x;
double view_sy = oy - sview->y; double view_sy = oy - sview->y;