From e622be7423c873e633cf36177693d6ca335983fb Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Fri, 13 Oct 2023 07:37:20 -0500 Subject: [PATCH] input: avoid crash by using surface directly A constraint always has a surface, but may not have a view - use the surface pointer directly without trying to get it through the view. Fixes #823 Signed-off-by: Derek Foreman --- libweston/input.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libweston/input.c b/libweston/input.c index 25e3280e..c72c24be 100644 --- a/libweston/input.c +++ b/libweston/input.c @@ -5021,7 +5021,7 @@ locked_pointer_set_cursor_position_hint(struct wl_client *client, constraint->hint_is_pending = true; constraint->hint_pending = weston_coord_surface_from_fixed(surface_x, surface_y, - constraint->view->surface); + constraint->surface); } static void @@ -5659,7 +5659,7 @@ maybe_warp_confined_pointer(struct weston_pointer_constraint *constraint) pixman_region32_init(&confine_region); pixman_region32_intersect(&confine_region, - &constraint->view->surface->input, + &constraint->surface->input, &constraint->region); assert(pixman_region32_not_empty(&confine_region)); region_to_outline(&confine_region, &borders);