summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandros Frantzis <alexandros.frantzis@collabora.com>2022-09-08 14:05:17 +0300
committerMarius Vlad <marius.vlad@collabora.com>2022-09-14 17:08:09 +0300
commit0669d4de4f225533a0559395c3ee923124123865 (patch)
treee3c7a7bfd186e7dc087d750ba4f6f9bc94b9c103
parentb87418e4c4007b9a118dabf95fa3533361257724 (diff)
libweston: Skip views without a layer assignment in output_mask calculations
Surface views that are not assigned to a layer are not going to be rendered, and thus should not participate in determining the outputs the surface is on. There are other view properties that may determine if the view should be considered in output_mask calculations, e.g., is_mapped, but checking for this currently breaks tests. Such additional checks are left for future fixes or reworkings of the view infrastructure. Fixes #646 Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
-rw-r--r--libweston/compositor.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/libweston/compositor.c b/libweston/compositor.c
index 30913cbc..6cfcba25 100644
--- a/libweston/compositor.c
+++ b/libweston/compositor.c
@@ -1300,6 +1300,14 @@ weston_view_set_output(struct weston_view *view, struct weston_output *output)
}
}
+static struct weston_layer *
+get_view_layer(struct weston_view *view)
+{
+ if (view->parent_view)
+ return get_view_layer(view->parent_view);
+ return view->layer_link.layer;
+}
+
/** Recalculate which output(s) the surface has views displayed on
*
* \param es The surface to remap to outputs
@@ -1325,7 +1333,9 @@ weston_surface_assign_output(struct weston_surface *es)
mask = 0;
pixman_region32_init(&region);
wl_list_for_each(view, &es->views, surface_link) {
- if (!view->output)
+ /* Only views that are visible on some layer participate in
+ * output_mask calculations. */
+ if (!view->output || !get_view_layer(view))
continue;
pixman_region32_intersect(&region, &view->transform.boundingbox,
@@ -1605,14 +1615,6 @@ weston_view_update_transform_enable(struct weston_view *view)
return 0;
}
-static struct weston_layer *
-get_view_layer(struct weston_view *view)
-{
- if (view->parent_view)
- return get_view_layer(view->parent_view);
- return view->layer_link.layer;
-}
-
WL_EXPORT void
weston_view_update_transform(struct weston_view *view)
{