diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-05-20 08:34:43 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-05-21 20:16:56 +1000 |
commit | bd79584f659428df5d34f64f3b1cdb4c4388c3c6 (patch) | |
tree | ab178bfbb0b0a838926b48553f72c3073bb469d9 /sway | |
parent | c08f9bf257c38c92a75988d89fba2d4de6bb2aea (diff) |
Add assertion in container_at_view
Diffstat (limited to 'sway')
-rw-r--r-- | sway/tree/container.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c index 76a21c19..62dca487 100644 --- 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; |