aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Vlad <marius.vlad@collabora.com>2020-07-10 15:01:28 +0300
committerScott Murray <scott.murray@konsulko.com>2020-07-29 13:12:04 +0000
commitc7bc55dce459ea25f725410fc1b86dd9534a9ed5 (patch)
tree0842751dcb90bbdd514ce2c61990636d5a7d0d73
parentbf016d20408920f3ef09894ebb9f237e270267e5 (diff)
layout: Add missing hooks for other surface rolesjellyfish_9.99.3jellyfish/9.99.39.99.3
We are missing the activate_by_default hooks for split, pop-up and and fullscreen roles. Part of that is due to the fact that these roles are handled a bit differently that the remote and desktop roles. Note, these hooks are different than the commit ones -- which are 'installed' a bit earlier. This means that there was still a possiblity one might've used that hook to retrieve the surface role for instance, and act accordingly. Also, note that we allow for pop-up/dialogs be activated by using the deliberate 'activate' request, which allows one to customize the policy to deny certain pop-up/dialogs to be activated by default, but allow do so explictly when using the 'activate' request. Bug-AGL: SPEC-3494 Reported-by: Scott Murray <scott.murray@konsulko.com> Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I634bbb5915e65880c1d47363cf6dae529feac9d2
-rw-r--r--src/layout.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/layout.c b/src/layout.c
index d8d0196..fa49163 100644
--- a/src/layout.c
+++ b/src/layout.c
@@ -366,6 +366,7 @@ void
ivi_layout_fullscreen_committed(struct ivi_surface *surface)
{
struct ivi_compositor *ivi = surface->ivi;
+ struct ivi_policy *policy = ivi->policy;
struct weston_desktop_surface *dsurface = surface->dsurface;
struct weston_surface *wsurface =
@@ -378,6 +379,11 @@ ivi_layout_fullscreen_committed(struct ivi_surface *surface)
struct weston_view *view = surface->view;
struct weston_geometry geom;
+ if (policy && policy->api.surface_activate_by_default &&
+ !policy->api.surface_activate_by_default(surface, surface->ivi) &&
+ !surface->activated_by_default)
+ return;
+
if (surface->view->is_mapped)
return;
@@ -430,6 +436,7 @@ void
ivi_layout_split_committed(struct ivi_surface *surface)
{
struct ivi_compositor *ivi = surface->ivi;
+ struct ivi_policy *policy = ivi->policy;
struct weston_desktop_surface *dsurface = surface->dsurface;
struct weston_surface *wsurface =
@@ -448,6 +455,11 @@ ivi_layout_split_committed(struct ivi_surface *surface)
x = woutput->x;
y = woutput->y;
+ if (policy && policy->api.surface_activate_by_default &&
+ !policy->api.surface_activate_by_default(surface, surface->ivi) &&
+ !surface->activated_by_default)
+ return;
+
if (surface->view->is_mapped)
return;
@@ -522,6 +534,7 @@ void
ivi_layout_popup_committed(struct ivi_surface *surface)
{
struct ivi_compositor *ivi = surface->ivi;
+ struct ivi_policy *policy = ivi->policy;
struct weston_desktop_surface *dsurface = surface->dsurface;
struct weston_surface *wsurface =
@@ -533,6 +546,11 @@ ivi_layout_popup_committed(struct ivi_surface *surface)
struct weston_view *view = surface->view;
+ if (policy && policy->api.surface_activate_by_default &&
+ !policy->api.surface_activate_by_default(surface, surface->ivi) &&
+ !surface->activated_by_default)
+ return;
+
if (surface->view->is_mapped)
return;
@@ -580,6 +598,11 @@ ivi_layout_popup_re_add(struct ivi_surface *surface)
view->is_mapped = false;
}
+ /* reset the activate by default in order to (still) allow the surface
+ * to be activaved using the request */
+ if (!surface->activated_by_default)
+ surface->activated_by_default = true;
+
ivi_layout_popup_committed(surface);
}
@@ -594,6 +617,11 @@ ivi_layout_surface_is_split_or_fullscreen(struct ivi_surface *surf)
surf->role != IVI_SURFACE_ROLE_FULLSCREEN)
return false;
+ /* reset the activate by default in order to (still) allow the surface
+ * to be activaved using the request */
+ if (!surf->activated_by_default)
+ surf->activated_by_default = true;
+
wl_list_for_each(is, &ivi->surfaces, link)
if (is == surf)
return true;