diff options
author | 2022-09-01 15:19:59 +0300 | |
---|---|---|
committer | 2022-09-14 19:42:31 +0300 | |
commit | 0512e7251611e7040c550bb4c6cc972d57b45144 (patch) | |
tree | a7531f55b4688af422277ea48eb07034b4c122ec /src/shell.c | |
parent | bb730ca304a5f62889038cb1bc6509afb869ee95 (diff) |
protocol/agl-shell.xml: Add an app_state event -- app state notification
This protocol bump will notify the client binding to the agl-shell protocol
when a particular application changed its state.
This includes four (4) different events:
- started
- terminated
- activated
- deactivated
This should allow orchestrating start-up with activation as we don't
really know when it would be the proper time to activate an application
when starting up (for the first time). A started event will notify the
shell client we it can do that. These events are not sticky such that
the shell would be responsabile for keep track of the state, if it
wants to.
Bug-AGL: SPEC-4528
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Id162874fa68946bb9b1db9fa356dd617a0db9eb7
Diffstat (limited to 'src/shell.c')
-rw-r--r-- | src/shell.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/shell.c b/src/shell.c index 4ab5e42..f7ec6a2 100644 --- a/src/shell.c +++ b/src/shell.c @@ -1052,10 +1052,19 @@ shell_ready(struct wl_client *client, struct wl_resource *shell_res) } wl_list_for_each_safe(surface, tmp, &ivi->pending_surfaces, link) { + const char *app_id; + wl_list_remove(&surface->link); wl_list_init(&surface->link); ivi_check_pending_desktop_surface(surface); surface->checked_pending = true; + app_id = weston_desktop_surface_get_app_id(surface->dsurface); + + if (app_id && + wl_resource_get_version(ivi->shell_client.resource) >= + AGL_SHELL_APP_STATE_SINCE_VERSION) + agl_shell_send_app_state(ivi->shell_client.resource, + app_id, AGL_SHELL_APP_STATE_STARTED); } } @@ -1532,7 +1541,7 @@ int ivi_shell_create_global(struct ivi_compositor *ivi) { ivi->agl_shell = wl_global_create(ivi->compositor->wl_display, - &agl_shell_interface, 2, + &agl_shell_interface, 3, ivi, bind_agl_shell); if (!ivi->agl_shell) { weston_log("Failed to create wayland global.\n"); |