summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Vlad <marius.vlad@collabora.com>2020-05-02 18:20:20 +0300
committerMarius Vlad <marius.vlad@collabora.com>2020-06-08 17:26:36 +0300
commit496b41700142ba76001b6e8a400c7e563768cb4b (patch)
tree3779d57c02d092139d6912d4c3f50389030e604b
parenta9ae8d75026b1fa1ef32d143da23bc8ee9aedeaa (diff)
layout: Do not attempt to activate a split or a fs surface
As long as there is (an already created) surface in a split/fs type of role there's no point in trying to activate it. Users can mistakenly try to do that so have some logic in place to avoid it. Bug-AGL: SPEC-3334 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: Id9b8e039b6d53fbfb4e310166a91c2cb6a45cb4e
-rw-r--r--src/layout.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/layout.c b/src/layout.c
index bcaf897..1466fdb 100644
--- a/src/layout.c
+++ b/src/layout.c
@@ -306,7 +306,7 @@ ivi_layout_fullscreen_committed(struct ivi_surface *surface)
weston_log("(fs) geom x %d, y %d, width %d, height %d\n", geom.x, geom.y,
geom.width, geom.height);
- assert(surface->role == IVI_SURFACE_ROLE_FS);
+ assert(surface->role == IVI_SURFACE_ROLE_FULLSCREEN);
weston_desktop_surface_set_fullscreen(dsurface, true);
@@ -551,6 +551,24 @@ ivi_layout_panel_committed(struct ivi_surface *surface)
surface->view->is_mapped = true;
}
+static bool
+ivi_layout_surface_is_split_or_fullscreen(struct ivi_surface *surf)
+{
+ struct ivi_compositor *ivi = surf->ivi;
+ struct ivi_surface *is;
+
+ if (surf->role != IVI_SURFACE_ROLE_SPLIT_H &&
+ surf->role != IVI_SURFACE_ROLE_SPLIT_V &&
+ surf->role != IVI_SURFACE_ROLE_FULLSCREEN)
+ return false;
+
+ wl_list_for_each(is, &ivi->surfaces, link)
+ if (is == surf)
+ return true;
+
+ return false;
+}
+
void
ivi_layout_activate(struct ivi_output *output, const char *app_id)
{
@@ -579,9 +597,12 @@ ivi_layout_activate(struct ivi_output *output, const char *app_id)
return;
}
- if (surf == output->active)
+ /* do not 're'-activate surfaces that are split or active */
+ if (surf == output->active ||
+ ivi_layout_surface_is_split_or_fullscreen(surf))
return;
+
dsurf = surf->dsurface;
view = surf->view;
geom = weston_desktop_surface_get_geometry(dsurf);