[PATCH weston] compositor: rebuild the global list if we've removed a surface from it
Eoff, Ullysses A
ullysses.a.eoff at intel.com
Wed Jun 26 10:30:32 PDT 2013
Confirmed. This patch fixes https://bugs.freedesktop.org/show_bug.cgi?id=65986.
It was a tricky one to reproduce, but after about 50 tries I could not trigger the issue
with this patch.
Confirmed that this patch also fixes https://bugs.freedesktop.org/show_bug.cgi?id=66198
;-)
----
U. Artie
> -----Original Message-----
> From: wayland-devel-bounces+ullysses.a.eoff=intel.com at lists.freedesktop.org [mailto:wayland-devel-
> bounces+ullysses.a.eoff=intel.com at lists.freedesktop.org] On Behalf Of Rob Bradford
> Sent: Wednesday, June 26, 2013 10:09 AM
> To: wayland-devel at lists.freedesktop.org
> Cc: Rob Bradford
> Subject: [PATCH weston] compositor: rebuild the global list if we've removed a surface from it
>
> From: Rob Bradford <rob at linux.intel.com>
>
> The list of surfaces used by weston_compositor_pick_surface() is
> maintained in list of surfaces stored on the compositor. This list is
> generated from the surfaces across all the layers using
> weston_compositor_build_surface_list.
>
> When destroying a surface the surface is "unmapped" with
> weston_surface_unmap which removes it from the layer list. However since
> the compositor surface list was only being rebuilt when the output was
> repainted a call to weston_compositor_pick_surface before the next
> output repaint would use an outdated surface list containing surfaces
> that have been partially destroyed.
>
> https://bugs.freedesktop.org/show_bug.cgi?id=65986
> ---
> src/compositor.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/src/compositor.c b/src/compositor.c
> index 43d8965..0a8cfff 100644
> --- a/src/compositor.c
> +++ b/src/compositor.c
> @@ -93,6 +93,9 @@ static void
> weston_output_transform_scale_init(struct weston_output *output,
> uint32_t transform, uint32_t scale);
>
> +static void
> +weston_compositor_build_surface_list(struct weston_compositor *compositor);
> +
> WL_EXPORT int
> weston_output_switch_mode(struct weston_output *output, struct weston_mode *mode, int32_t scale)
> {
> @@ -1011,8 +1014,10 @@ weston_surface_destroy(struct weston_surface *surface)
> assert(wl_list_empty(&surface->subsurface_list_pending));
> assert(wl_list_empty(&surface->subsurface_list));
>
> - if (weston_surface_is_mapped(surface))
> + if (weston_surface_is_mapped(surface)) {
> weston_surface_unmap(surface);
> + weston_compositor_build_surface_list(compositor);
> + }
>
> wl_list_for_each_safe(cb, next,
> &surface->pending.frame_callback_list, link)
> --
> 1.8.3.1
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
More information about the wayland-devel
mailing list