We were calling weston_surface::committed on surfaces with no buffer attached. Stop doing that, since surface::committed will map the surfaces and put them in a visible layer. That may not be a problem for a single surface as it wouldn't be visible anyway because it's got no contents, but it is a problem if the surface has subsurfaces.
This fixes the subsurface_mapped test, so mark it as expected to succeed. https://bugs.freedesktop.org/show_bug.cgi?id=94735 Signed-off-by: Emilio Pozuelo Monfort <emilio.pozu...@collabora.co.uk> --- libweston/compositor.c | 10 +++++++++- tests/subsurface-shot-test.c | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/libweston/compositor.c b/libweston/compositor.c index 81392063..8a018897 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -1589,6 +1589,12 @@ weston_surface_is_mapped(struct weston_surface *surface) return surface->is_mapped; } +static bool +weston_surface_has_content(struct weston_surface *surface) +{ + return surface->width > 0 && surface->height > 0; +} + static void surface_set_size(struct weston_surface *surface, int32_t width, int32_t height) { @@ -2928,7 +2934,9 @@ weston_surface_commit_state(struct weston_surface *surface, if (state->newly_attached || state->buffer_viewport.changed) { weston_surface_update_size(surface); - if (surface->committed) + if (surface->committed && + (state->newly_attached && + weston_surface_has_content(surface))) surface->committed(surface, state->sx, state->sy); } diff --git a/tests/subsurface-shot-test.c b/tests/subsurface-shot-test.c index e7da1e0e..275d4726 100644 --- a/tests/subsurface-shot-test.c +++ b/tests/subsurface-shot-test.c @@ -261,7 +261,7 @@ TEST(subsurface_z_order) buffer_destroy(bufs[i]); } -FAIL_TEST(subsurface_mapped) +TEST(subsurface_mapped) { const char *test_name = get_test_name(); struct client *client; -- 2.11.0 _______________________________________________ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel