From 9701fd67de31e7f6bd5aa36a98577ccc5ad42f44 Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Mon, 8 Jun 2020 21:11:12 +0300 Subject: [PATCH] shell: Advertise application_id event for other surface roles application_id event is sent just when a client binds to the agl_desktop_shell interface and when new desktop role surface were created, skipping split, fullscreen and pop-up kind of surface. This patch sends the application_id event for those as well. Makes SPEC-3412 much easier to determine when the application itself was started. Bug-AGL: SPEC-3412 Signed-off-by: Marius Vlad Change-Id: Ic5c0ebf130fda45c5fda89e0e27e81dea96195cd --- src/shell.c | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/src/shell.c b/src/shell.c index ac41e1f..f969503 100644 --- a/src/shell.c +++ b/src/shell.c @@ -45,15 +45,11 @@ static void create_black_surface_view(struct ivi_output *output); -void -ivi_set_desktop_surface(struct ivi_surface *surface) +static void +agl_shell_desktop_advertise_application_id(struct ivi_compositor *ivi, + struct ivi_surface *surface) { struct desktop_client *dclient; - struct ivi_compositor *ivi = surface->ivi; - assert(surface->role == IVI_SURFACE_ROLE_NONE); - - surface->role = IVI_SURFACE_ROLE_DESKTOP; - wl_list_insert(&surface->ivi->surfaces, &surface->link); /* advertise to all desktop clients the new surface */ wl_list_for_each(dclient, &ivi->desktop_clients, link) { @@ -63,6 +59,18 @@ ivi_set_desktop_surface(struct ivi_surface *surface) } } +void +ivi_set_desktop_surface(struct ivi_surface *surface) +{ + struct ivi_compositor *ivi = surface->ivi; + assert(surface->role == IVI_SURFACE_ROLE_NONE); + + surface->role = IVI_SURFACE_ROLE_DESKTOP; + wl_list_insert(&surface->ivi->surfaces, &surface->link); + + agl_shell_desktop_advertise_application_id(ivi, surface); +} + static void ivi_set_desktop_surface_popup(struct ivi_surface *surface) { @@ -71,6 +79,8 @@ ivi_set_desktop_surface_popup(struct ivi_surface *surface) surface->role = IVI_SURFACE_ROLE_POPUP; wl_list_insert(&ivi->surfaces, &surface->link); + + agl_shell_desktop_advertise_application_id(ivi, surface); } static void @@ -81,6 +91,8 @@ ivi_set_desktop_surface_fullscreen(struct ivi_surface *surface) surface->role = IVI_SURFACE_ROLE_FULLSCREEN; wl_list_insert(&ivi->surfaces, &surface->link); + + agl_shell_desktop_advertise_application_id(ivi, surface); } static void @@ -119,6 +131,8 @@ ivi_set_desktop_surface_split(struct ivi_surface *surface) surface->role = IVI_SURFACE_ROLE_SPLIT_H; wl_list_insert(&ivi->surfaces, &surface->link); + + agl_shell_desktop_advertise_application_id(ivi, surface); } static void -- 2.16.6