diff options
author | Marius Vlad <marius.vlad@collabora.com> | 2020-04-20 19:37:00 +0300 |
---|---|---|
committer | Marius Vlad <marius.vlad@collabora.com> | 2020-05-12 21:56:35 +0300 |
commit | ee9259703dc1d46339197c0d3a30e18556d708c9 (patch) | |
tree | 083f3417c379085711d276fa536148d55fcf47a8 | |
parent | 65f9de0a549b0af779c5bad7468aa757d57db6d4 (diff) |
policy: Add a new policy hook for deactivating apps
Bug-AGL: SPEC-3269
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I7260626819b78ff7e2a245dc0a5ef566919220f7
-rw-r--r-- | src/layout.c | 6 | ||||
-rw-r--r-- | src/policy.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/layout.c b/src/layout.c index 0e7aaaf..6f6c763 100644 --- a/src/layout.c +++ b/src/layout.c @@ -503,11 +503,17 @@ ivi_layout_deactivate(struct ivi_compositor *ivi, const char *app_id) { struct ivi_surface *surf; struct ivi_output *ivi_output; + struct ivi_policy *policy = ivi->policy; surf = ivi_find_app(ivi, app_id); if (!surf) return; + if (policy && policy->api.surface_deactivate && + !policy->api.surface_deactivate(surf, surf->ivi)) { + return; + } + ivi_output = ivi_layout_get_output_from_surface(surf); weston_log("deactiving %s\n", app_id); diff --git a/src/policy.h b/src/policy.h index 947c326..2499278 100644 --- a/src/policy.h +++ b/src/policy.h @@ -70,6 +70,7 @@ struct ivi_policy_api { bool (*surface_create)(struct ivi_surface *surf, void *user_data); bool (*surface_commited)(struct ivi_surface *surf, void *user_data); bool (*surface_activate)(struct ivi_surface *surf, void *user_data); + bool (*surface_deactivate)(struct ivi_surface *surf, void *user_data); bool (*surface_activate_by_default)(struct ivi_surface *surf, void *user_data); |