}
#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)
{
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);
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;
*
!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) {
int32_t width, height;
} pending;
bool activated_by_default;
+ bool advertised_on_launch;
enum ivi_surface_role role;
union {
struct ivi_split_surface split;
struct ivi_remote_surface remote;
};
+
+ struct wl_listener listener_advertise_app;
+ struct wl_signal signal_advertise_app;
};
struct ivi_shell_client {
void
ivi_seat_reset_caps_sent(struct ivi_compositor *ivi);
+void
+agl_shell_desktop_advertise_application_id(struct ivi_compositor *ivi,
+ struct ivi_surface *surface);
#endif
static void
create_black_surface_view(struct ivi_output *output);
-static void
+void
agl_shell_desktop_advertise_application_id(struct ivi_compositor *ivi,
struct ivi_surface *surface)
{
struct desktop_client *dclient;
+ if (surface->advertised_on_launch)
+ return;
+
/* advertise to all desktop clients the new surface */
wl_list_for_each(dclient, &ivi->desktop_clients, link) {
const char *app_id =
return;
}
agl_shell_desktop_send_application(dclient->resource, app_id);
+ surface->advertised_on_launch = true;
}
}