From 39ea644837dd29cd47a579a9703b43458187f82b Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Fri, 26 Jun 2020 16:04:38 +0300 Subject: [PATCH] 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 --- src/desktop.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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); -- 2.16.6