desktop: Display a black surface for apps being moved using config file 60/24660/3
authorMarius Vlad <marius.vlad@collabora.com>
Mon, 1 Jun 2020 18:46:32 +0000 (21:46 +0300)
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>
Mon, 15 Jun 2020 10:08:58 +0000 (10:08 +0000)
Just like the 'remote' surface roles, put back a black surface if
there's no background set and if it is the last surface on that output.

Bug-AGL: SPEC-3280

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I7bd7ae55fc668753223a23462b697071faa16525

src/desktop.c

index a3552e2..f8c614f 100644 (file)
@@ -112,13 +112,13 @@ desktop_surface_added(struct weston_desktop_surface *dsurface, void *userdata)
 }
 
 static bool
-desktop_surface_check_last_remote_surfaces(struct ivi_compositor *ivi)
+desktop_surface_check_last_remote_surfaces(struct ivi_compositor *ivi, enum ivi_surface_role role)
 {
        int count = 0;
        struct ivi_surface *surf;
 
        wl_list_for_each(surf, &ivi->surfaces, link)
-               if (surf->role == IVI_SURFACE_ROLE_REMOTE)
+               if (surf->role == role)
                        count++;
 
        return (count == 1);
@@ -157,7 +157,13 @@ desktop_surface_removed(struct weston_desktop_surface *dsurface, void *userdata)
        /* check if there's a last 'remote' surface and insert a black
         * surface view if there's no background set for that output
         */
-       if (desktop_surface_check_last_remote_surfaces(output->ivi))
+       if (desktop_surface_check_last_remote_surfaces(output->ivi,
+           IVI_SURFACE_ROLE_REMOTE))
+               if (!output->background)
+                       insert_black_surface(output);
+
+       if (desktop_surface_check_last_remote_surfaces(output->ivi,
+           IVI_SURFACE_ROLE_DESKTOP))
                if (!output->background)
                        insert_black_surface(output);