commit bd79584f659428df5d34f64f3b1cdb4c4388c3c6
parent c08f9bf257c38c92a75988d89fba2d4de6bb2aea
Author: Ryan Dwyer <ryandwyer1@gmail.com>
Date: Sun, 20 May 2018 08:34:43 +1000
Add assertion in container_at_view
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/sway/tree/container.c b/sway/tree/container.c
@@ -455,6 +455,9 @@ struct sway_container *container_parent(struct sway_container *container,
static struct sway_container *container_at_view(struct sway_container *swayc,
double ox, double oy,
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;
double view_sx = ox - sview->x;
double view_sy = oy - sview->y;