mirror of
https://gitlab.freedesktop.org/wayland/weston
synced 2024-10-05 00:17:15 +00:00
surface: Check parents in weston_surface_is_mapped()
A subsurface is not considered to be fully 'mapped' unless its ancestors are also mapped. Signed-off-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
parent
2faf491f61
commit
cae789774a
|
@ -2136,7 +2136,22 @@ weston_view_find_paint_node(struct weston_view *view,
|
||||||
WL_EXPORT bool
|
WL_EXPORT bool
|
||||||
weston_surface_is_mapped(struct weston_surface *surface)
|
weston_surface_is_mapped(struct weston_surface *surface)
|
||||||
{
|
{
|
||||||
return surface->is_mapped;
|
struct weston_subsurface *sub = weston_surface_to_subsurface(surface);
|
||||||
|
|
||||||
|
/* This surface isn't mapped. */
|
||||||
|
if (!surface->is_mapped)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
/* This surface is mapped, and has no parents to refer to. */
|
||||||
|
if (!sub || sub->parent == surface)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
/* This subsurface's parent has since vanished. */
|
||||||
|
if (!sub->parent)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
/* Check recursively up its parent tree. */
|
||||||
|
return weston_surface_is_mapped(sub->parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check if the weston_surface is emitting an mapping commit
|
/** Check if the weston_surface is emitting an mapping commit
|
||||||
|
|
Loading…
Reference in a new issue