compositor: Only create paint nodes for mapped surfaces/views

If a surface or a view is not mapped, then we should not be trying to
paint it. Check if this is the case and ensure that we only insert
paint nodes for mapped surfaces & views.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Fixes: #621
dev
Daniel Stone 2 years ago committed by Marius Vlad
parent f1fe6ec776
commit f962b48958
  1. 4
      include/libweston/libweston.h
  2. 20
      libweston/compositor.c

@ -1311,6 +1311,10 @@ struct weston_compositor {
struct weston_log_scope *libseat_debug; struct weston_log_scope *libseat_debug;
struct content_protection *content_protection; struct content_protection *content_protection;
/* One-time warning about a view appearing in the layer list when it
* or its surface are not mapped. */
bool warned_about_unmapped_surface_or_view;
}; };
struct weston_buffer { struct weston_buffer {

@ -2991,6 +2991,26 @@ view_list_add(struct weston_compositor *compositor,
struct weston_subsurface *sub; struct weston_subsurface *sub;
weston_view_update_transform(view); weston_view_update_transform(view);
/* It is possible for a view to appear in the layer list even though
* the view or the surface is unmapped. This is erroneous but difficult
* to fix. */
if (!weston_surface_is_mapped(view->surface) ||
!weston_view_is_mapped(view) ||
!weston_surface_has_content(view->surface)) {
if (!compositor->warned_about_unmapped_surface_or_view) {
weston_log("Detected an unmapped surface or view in "
"the layer list, which should not occur.\n");
compositor->warned_about_unmapped_surface_or_view = true;
}
pnode = weston_view_find_paint_node(view, output);
if (pnode)
weston_paint_node_destroy(pnode);
return;
}
pnode = view_ensure_paint_node(view, output); pnode = view_ensure_paint_node(view, output);
if (wl_list_empty(&view->surface->subsurface_list)) { if (wl_list_empty(&view->surface->subsurface_list)) {

Loading…
Cancel
Save