libweston/compositor: Do not map subsurfaces without buffer

We can end in `subsurface_committed()` in different scenarios
without the surface having an attached buffer. While setting
the mapped state to `true` in that case doesn't matter for
that (sub)surface itself, it triggers its own child subsurfaces
to get mapped when they shouldn't.

Closes https://gitlab.freedesktop.org/wayland/weston/-/issues/426

Signed-off-by: Robert Mader <robert.mader@collabora.com>
This commit is contained in:
Robert Mader 2022-01-26 22:04:52 +01:00 committed by Daniel Stone
parent 73b17da7d5
commit 8b04534c76

View file

@ -4364,7 +4364,7 @@ subsurface_committed(struct weston_surface *surface, int32_t dx, int32_t dy)
*/
if (!weston_surface_is_mapped(surface)) {
surface->is_mapped = true;
surface->is_mapped = surface->buffer_ref.buffer != NULL;
/* Cannot call weston_view_update_transform(),
* because that would call it also for the parent surface,