diff options
author | Walter Lozano <walter.lozano@collabora.com> | 2020-09-23 13:31:23 +0000 |
---|---|---|
committer | Jan-Simon Moeller <jsmoeller@linuxfoundation.org> | 2020-10-15 09:33:47 +0000 |
commit | fe771c084c2f0192ca08dd3b7f85088960703e36 (patch) | |
tree | ad8cb121acf994dc9bc8f61281a393641f8366ae /src/desktop.c | |
parent | abe3abc327b7d770b81f976d79f12112010e6a4e (diff) |
shell: Advertise app when app_id is available
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
Diffstat (limited to 'src/desktop.c')
-rw-r--r-- | src/desktop.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/desktop.c b/src/desktop.c index 58d2887..87ba7e1 100644 --- a/src/desktop.c +++ b/src/desktop.c @@ -43,6 +43,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) { /* not supported */ @@ -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) { |