shell: Advertise application_id event for other surface roles 52/24652/2
authorMarius Vlad <marius.vlad@collabora.com>
Mon, 8 Jun 2020 18:11:12 +0000 (21:11 +0300)
committerMarius Vlad <marius.vlad@collabora.com>
Mon, 15 Jun 2020 17:18:52 +0000 (20:18 +0300)
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 <marius.vlad@collabora.com>
Change-Id: Ic5c0ebf130fda45c5fda89e0e27e81dea96195cd

src/shell.c

index ac41e1f..f969503 100644 (file)
 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