When using GTK-3 to create apps, the framework issues set_parent_id
which forces a surface to be added even before the app_id is set.
This causes the compositor to fail to advertise the app.
This patch tries to overcome this issue by checking on surface commit
if the surface was previously advertised, and do it if it was not.
Signed-off-by: Walter Lozano <walter.lozano@collabora.com>
Change-Id: I4e5fec82c1008c30d8ae7d213d85a82e39c404c3
+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)
{
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->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);
weston_desktop_surface_set_user_data(dsurface, surface);
struct ivi_output *output = ivi_layout_get_output_from_surface(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;
*
/* 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;
!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) {
weston_compositor_schedule_repaint(surface->ivi->compositor);
switch (surface->role) {
int32_t width, height;
} pending;
bool activated_by_default;
int32_t width, height;
} pending;
bool activated_by_default;
+ bool advertised_on_launch;
enum ivi_surface_role role;
union {
enum ivi_surface_role role;
union {
struct ivi_split_surface split;
struct ivi_remote_surface remote;
};
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 {
};
struct ivi_shell_client {
void
ivi_seat_reset_caps_sent(struct ivi_compositor *ivi);
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);
wl_list_init(&ivi.remote_pending_apps);
wl_list_init(&ivi.desktop_clients);
wl_list_init(&ivi.remote_pending_apps);
wl_list_init(&ivi.desktop_clients);
/* Prevent any clients we spawn getting our stdin */
os_fd_set_cloexec(STDIN_FILENO);
/* Prevent any clients we spawn getting our stdin */
os_fd_set_cloexec(STDIN_FILENO);
static void
create_black_surface_view(struct ivi_output *output);
static void
create_black_surface_view(struct ivi_output *output);
agl_shell_desktop_advertise_application_id(struct ivi_compositor *ivi,
struct ivi_surface *surface)
{
struct desktop_client *dclient;
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 =
/* 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);
return;
}
agl_shell_desktop_send_application(dclient->resource, app_id);
+ surface->advertised_on_launch = true;