desktop: Insert a black surface only when the output is a remote type
[src/agl-compositor.git] / src / desktop.c
index 87ba7e1..4caba48 100644 (file)
@@ -195,15 +195,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,
-           IVI_SURFACE_ROLE_REMOTE))
+       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)) && output->type == OUTPUT_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);
 
        if (weston_surface_is_mapped(wsurface)) {
                weston_desktop_surface_unlink_view(surface->view);