desktop: Fix destruction of applications that fallback to the desktop role 03/24903/2
authorMarius Vlad <marius.vlad@collabora.com>
Fri, 26 Jun 2020 13:04:38 +0000 (16:04 +0300)
committerMarius Vlad <marius.vlad@collabora.com>
Fri, 3 Jul 2020 10:56:10 +0000 (13:56 +0300)
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 <marius.vlad@collabora.com>
Change-Id: If20bdcf02810c16167fdbfbf30f3fd367c43069b

src/desktop.c

index 5b7b2e5..0fca2fd 100644 (file)
@@ -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);