X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fdesktop.c;h=87ba7e151251975c2cf22f0e6c1562ff82224d0b;hb=0a22dff42d49d1a38137fc47c747620fdb3f3814;hp=58d288783c157ce225a98b3154aaf08f36b14f3f;hpb=3ba840cd3a5a2fa1966b01ef286de0347e64aa46;p=src%2Fagl-compositor.git diff --git a/src/desktop.c b/src/desktop.c index 58d2887..87ba7e1 100644 --- a/src/desktop.c +++ b/src/desktop.c @@ -42,6 +42,16 @@ get_default_output(struct weston_compositor *compositor) } #endif +static void +desktop_advertise_app(struct wl_listener *listener, void *data) +{ + struct ivi_surface *surface; + + surface = wl_container_of(listener, surface, listener_advertise_app); + + agl_shell_desktop_advertise_application_id(surface->ivi, surface); +} + static void desktop_ping_timeout(struct weston_desktop_client *dclient, void *userdata) { @@ -84,6 +94,13 @@ desktop_surface_added(struct weston_desktop_surface *dsurface, void *userdata) surface->dsurface = dsurface; surface->role = IVI_SURFACE_ROLE_NONE; surface->activated_by_default = false; + surface->advertised_on_launch = false; + + wl_signal_init(&surface->signal_advertise_app); + + surface->listener_advertise_app.notify = desktop_advertise_app; + wl_signal_add(&surface->signal_advertise_app, + &surface->listener_advertise_app); weston_desktop_surface_set_user_data(dsurface, surface); @@ -141,6 +158,9 @@ desktop_surface_removed(struct weston_desktop_surface *dsurface, void *userdata) struct ivi_output *output = ivi_layout_get_output_from_surface(surface); + wl_list_remove(&surface->listener_advertise_app.link); + surface->listener_advertise_app.notify = NULL; + /* special corner-case, pending_surfaces which are never activated or * being assigned an output might land here so just remove the surface; * @@ -237,6 +257,9 @@ desktop_committed(struct weston_desktop_surface *dsurface, !policy->api.surface_commited(surface, surface->ivi)) return; + if (!surface->advertised_on_launch) + wl_signal_emit(&surface->signal_advertise_app, surface); + weston_compositor_schedule_repaint(surface->ivi->compositor); switch (surface->role) {