From: Marius Vlad Date: Fri, 26 Jun 2020 13:04:38 +0000 (+0300) Subject: desktop: Fix destruction of applications that fallback to the desktop role X-Git-Tag: 9.99.2~1 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=39ea644837dd29cd47a579a9703b43458187f82b;p=src%2Fagl-compositor.git desktop: Fix destruction of applications that fallback to the desktop role With commit 9827cfd25578, application not having a valid app_id will fallback to being assigned the desktop role. In this case, destroying those kind of surfaces will not have an output assigned, so add a code path for those as well. Found while testing cluster-receiver with waylandsink and sub-surfaces. Bug-AGL: SPEC-3382 Signed-off-by: Marius Vlad Change-Id: If20bdcf02810c16167fdbfbf30f3fd367c43069b --- diff --git a/src/desktop.c b/src/desktop.c index 5b7b2e5..0fca2fd 100644 --- a/src/desktop.c +++ b/src/desktop.c @@ -139,8 +139,13 @@ desktop_surface_removed(struct weston_desktop_surface *dsurface, void *userdata) struct ivi_output *output = ivi_layout_get_output_from_surface(surface); /* special corner-case, pending_surfaces which are never activated or - * being assigned an output might land here so just remove the surface */ - if (output == NULL && surface->role == IVI_SURFACE_ROLE_NONE) + * being assigned an output might land here so just remove the surface; + * + * the DESKTOP role can happen here as well, because we can fall-back + * to that when we try to determine the role type. Application that + * do not set the app_id will be land here, when destroyed */ + if (output == NULL && (surface->role == IVI_SURFACE_ROLE_NONE || + surface->role == IVI_SURFACE_ROLE_DESKTOP)) goto skip_output_asignment; assert(output != NULL);