diff options
author | Marius Vlad <marius.vlad@collabora.com> | 2020-07-12 19:34:00 +0300 |
---|---|---|
committer | Scott Murray <scott.murray@konsulko.com> | 2020-07-29 13:11:59 +0000 |
commit | bf016d20408920f3ef09894ebb9f237e270267e5 (patch) | |
tree | 1439085020d6da5ada1c8f4674280d6343b39520 | |
parent | 35f6733fb39bc83cc16652a3da849d9f383263ef (diff) |
layout: Advertise state change for other types of surface roles
Given that now other surfaces roles will be active by default, we need
to let other application aware of that fact by advertising state change.
Print some debug message while at it, to make it more consistent with
the desktop role.
Bug-AGL: SPEC-3494
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Ia9d959a0912e330303fa3d959ce600237edf35b4
-rw-r--r-- | src/ivi-compositor.h | 4 | ||||
-rw-r--r-- | src/layout.c | 21 | ||||
-rw-r--r-- | src/shell.c | 3 |
3 files changed, 26 insertions, 2 deletions
diff --git a/src/ivi-compositor.h b/src/ivi-compositor.h index 7b5c18f..79b2255 100644 --- a/src/ivi-compositor.h +++ b/src/ivi-compositor.h @@ -371,4 +371,8 @@ ivi_set_pending_desktop_surface_remote(struct ivi_output *ioutput, struct ivi_output * ivi_layout_find_with_app_id(const char *app_id, struct ivi_compositor *ivi); +void +shell_advertise_app_state(struct ivi_compositor *ivi, const char *app_id, + const char *data, uint32_t app_state); + #endif diff --git a/src/layout.c b/src/layout.c index c078ac9..d8d0196 100644 --- a/src/layout.c +++ b/src/layout.c @@ -370,6 +370,7 @@ ivi_layout_fullscreen_committed(struct ivi_surface *surface) struct weston_desktop_surface *dsurface = surface->dsurface; struct weston_surface *wsurface = weston_desktop_surface_get_surface(dsurface); + const char *app_id = weston_desktop_surface_get_app_id(dsurface); struct ivi_output *output = surface->split.output; struct weston_output *woutput = output->output; @@ -397,6 +398,12 @@ ivi_layout_fullscreen_committed(struct ivi_surface *surface) wsurface->is_mapped = true; surface->view->is_mapped = true; + + shell_advertise_app_state(ivi, app_id, + NULL, AGL_SHELL_DESKTOP_APP_STATE_ACTIVATED); + + weston_log("Activation completed for app_id %s, role %s, output %s\n", + app_id, ivi_layout_get_surface_role_name(surface), output->name); } void @@ -427,6 +434,7 @@ ivi_layout_split_committed(struct ivi_surface *surface) struct weston_desktop_surface *dsurface = surface->dsurface; struct weston_surface *wsurface = weston_desktop_surface_get_surface(dsurface); + const char *app_id = weston_desktop_surface_get_app_id(dsurface); struct ivi_output *output = surface->split.output; struct weston_output *woutput = output->output; @@ -502,6 +510,12 @@ ivi_layout_split_committed(struct ivi_surface *surface) wsurface->is_mapped = true; surface->view->is_mapped = true; + + shell_advertise_app_state(ivi, app_id, + NULL, AGL_SHELL_DESKTOP_APP_STATE_ACTIVATED); + + weston_log("Activation completed for app_id %s, role %s, output %s\n", + app_id, ivi_layout_get_surface_role_name(surface), output->name); } void @@ -512,6 +526,7 @@ ivi_layout_popup_committed(struct ivi_surface *surface) struct weston_desktop_surface *dsurface = surface->dsurface; struct weston_surface *wsurface = weston_desktop_surface_get_surface(dsurface); + const char *app_id = weston_desktop_surface_get_app_id(dsurface); struct ivi_output *output = surface->popup.output; struct weston_output *woutput = output->output; @@ -540,6 +555,12 @@ ivi_layout_popup_committed(struct ivi_surface *surface) wsurface->is_mapped = true; surface->view->is_mapped = true; + + shell_advertise_app_state(ivi, app_id, + NULL, AGL_SHELL_DESKTOP_APP_STATE_ACTIVATED); + + weston_log("Activation completed for app_id %s, role %s, output %s\n", + app_id, ivi_layout_get_surface_role_name(surface), output->name); } static void diff --git a/src/shell.c b/src/shell.c index 2978cc3..c884f16 100644 --- a/src/shell.c +++ b/src/shell.c @@ -793,8 +793,7 @@ shell_set_panel(struct wl_client *client, weston_desktop_surface_set_size(dsurface, width, height); } - -static void +void shell_advertise_app_state(struct ivi_compositor *ivi, const char *app_id, const char *data, uint32_t app_state) { |