From 3b70b66fa985697f53e5cccab608e29656552de6 Mon Sep 17 00:00:00 2001 From: Ander Conselvan de Oliveira Date: Thu, 9 Aug 2012 16:44:58 +0300 Subject: [PATCH] compositor: When redrawing, don't clip opaque regions from other planes When accumulating damage in the repaint loop, the opaque region of surfaces in other planes is added to the overall opaque region. This causes surface->clip to contain the areas obscured by surfaces in other planes. Change it to contain only the opaque region of surfaces in the primary plane This fixes a bug where moving a window that was just moved from the primary plane to another would leave artifacts on the screen. The problem was that the damage generated by weston_surface_move_to_plane() would be clipped on weston_surface_redraw(), leaving the contets below it unchanged. Moving the overlaid surface would no longer generate damage on the primary plane, so the contents would remain unchanged (i.e. wrong) indefinitely. --- src/compositor.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compositor.c b/src/compositor.c index 12fc157a..34df5f7c 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -1122,7 +1122,8 @@ surface_accumulate_damage(struct weston_surface *surface, &surface->plane->damage, &surface->damage); empty_region(&surface->damage); pixman_region32_copy(&surface->clip, opaque); - pixman_region32_union(opaque, opaque, &surface->transform.opaque); + if (surface->plane == &surface->compositor->primary_plane) + pixman_region32_union(opaque, opaque, &surface->transform.opaque); } static void