From 141943eb76e396eea798283f8681e7a2f5e34849 Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Mon, 13 Mar 2023 15:01:28 +0100 Subject: [PATCH] ivi-shell: handle subsurfaces for mouse/touch activation The surface of the focus_view may be a subsurface. So get the corresponding main surface first. Without this get_ivi_shell_surface(), will cast committed_private (which is a weston_subsurface object) to ivi_shell_surface. Weston crashes shortly afterwards. Signed-off-by: Michael Olbrich --- ivi-shell/ivi-shell.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c index c4430645a..9103f1d28 100644 --- a/ivi-shell/ivi-shell.c +++ b/ivi-shell/ivi-shell.c @@ -458,8 +458,10 @@ activate_binding(struct weston_seat *seat, uint32_t flags) { struct ivi_shell_surface *ivisurf, *ivisurf_child; + struct weston_surface *main_surface; - ivisurf = get_ivi_shell_surface(focus_view->surface); + main_surface = weston_surface_get_main_surface(focus_view->surface); + ivisurf = get_ivi_shell_surface(main_surface); if (ivisurf == NULL) return;