diff options
author | Marius Vlad <marius.vlad@collabora.com> | 2020-05-29 21:46:53 +0300 |
---|---|---|
committer | Jan-Simon Moeller <jsmoeller@linuxfoundation.org> | 2020-06-14 13:15:55 +0000 |
commit | 5c90f1639cada9e0d41bd1538bf62c0a12152ace (patch) | |
tree | e9cdaa71afdb17d8e2d7467a3679c88b265621a6 /src/desktop.c | |
parent | f88d870a4b6bd69460ddbb11c03c3a61b64da5cb (diff) |
src: Insert a black surface/remove it when the last remote
surface role is present
Bug-AGL: SPEC-3280
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ia47c0539ff26d1378bb9ac75e19592d7b8b2b3bf
Diffstat (limited to 'src/desktop.c')
-rw-r--r-- | src/desktop.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/desktop.c b/src/desktop.c index b9e45da..b8b88db 100644 --- a/src/desktop.c +++ b/src/desktop.c @@ -104,6 +104,19 @@ desktop_surface_added(struct weston_desktop_surface *dsurface, void *userdata) } } +static bool +desktop_surface_check_last_remote_surfaces(struct ivi_compositor *ivi) +{ + int count = 0; + struct ivi_surface *surf; + + wl_list_for_each(surf, &ivi->surfaces, link) + if (surf->role == IVI_SURFACE_ROLE_REMOTE) + count++; + + return (count == 1); +} + static void desktop_surface_removed(struct weston_desktop_surface *dsurface, void *userdata) { @@ -133,6 +146,14 @@ desktop_surface_removed(struct weston_desktop_surface *dsurface, void *userdata) weston_layer_entry_remove(&output->active->view->layer_link); output->active = NULL; } + + /* 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 (!output->background) + insert_black_surface(output); + if (weston_surface_is_mapped(wsurface)) { weston_desktop_surface_unlink_view(surface->view); weston_view_destroy(surface->view); |