shell: Remove the black curtain installed on outputs
[src/agl-compositor.git] / src / desktop.c
index 1cda129..37f4222 100644 (file)
@@ -242,13 +242,14 @@ desktop_surface_added(struct weston_desktop_surface *dsurface, void *userdata)
 }
 
 static bool
-desktop_surface_check_last_remote_surfaces(struct ivi_compositor *ivi, enum ivi_surface_role role)
+desktop_surface_check_last_surfaces(struct ivi_output *ivi_output, enum ivi_surface_role role)
 {
        int count = 0;
        struct ivi_surface *surf;
 
-       wl_list_for_each(surf, &ivi->surfaces, link)
-               if (surf->role == role)
+       wl_list_for_each(surf, &ivi_output->ivi->surfaces, link)
+               if (surf->role == role &&
+                   surf->current_completed_output == ivi_output)
                        count++;
 
        return (count == 1);
@@ -327,10 +328,10 @@ 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, IVI_SURFACE_ROLE_REMOTE) ||
-            desktop_surface_check_last_remote_surfaces(output->ivi, IVI_SURFACE_ROLE_DESKTOP))
+       if (desktop_surface_check_last_surfaces(output, IVI_SURFACE_ROLE_REMOTE) ||
+           desktop_surface_check_last_surfaces(output, IVI_SURFACE_ROLE_DESKTOP))
                if (!output->background)
-                       insert_black_surface(output);
+                       insert_black_curtain(output);
 
 
        if (weston_surface_is_mapped(wsurface)) {