[PATCH weston] compositor: when unmapping a surface remove it from the compositor's list

Giulio Camuffo giuliocamuffo at gmail.com
Sun Sep 22 05:27:41 PDT 2013


Oh, i just noticed you pushed your commit that removes the
weston_compositor_build_surface_list() but you didn't push this one. :)

2013/9/22 Giulio Camuffo <giuliocamuffo at gmail.com>:
> 2013/9/22 Kristian Høgsberg <hoegsberg at gmail.com>:
>> On Sat, Sep 21, 2013 at 06:08:28PM +0200, Giulio Camuffo wrote:
>>> compositor.surface_list is recreated every redraw with the mapped
>>> surfaces, but if a surface gets unmapped and then in the same frame
>>> weston_compositor_pick_surface() is called we must make sure it
>>> does not pick the unmapped surface, since it traverses the
>>> surface_list to find one.
>>> If after the unmap the surface gets also deleted it's even more
>>> important, as it must not pick a destroyed surface.
>>
>> We have a call to weston_compositor_build_surface_list() in after the
>> call to weston_surface_unmap() in weston_surface_destroy(), but we
>> should be able to keep the list uptodate as we unmap surfaces.  I
>> think we did it "just to be safe", but your patch should be enough and
>> if it isn't I want to find out what we're missing.
>
> Also, that weston_compositor_build_surface_list() wasn't called if the unmap was
> a result of a previous explicit wl_surface_attach(0) call
> ("wl_surface_attach(0); wl_surface_destroy()" from the client side), because the
> "if (weston_surface_is_mapped(surface))" failed.
>
> Giulio
>
>>
>> I'll push your patch and then remove the rebuild of the surface list
>> in weston_surface_destroy().
>>
>> Kristian
>>
>>
>>> ---
>>>  src/compositor.c | 2 ++
>>>  1 file changed, 2 insertions(+)
>>>
>>> diff --git a/src/compositor.c b/src/compositor.c
>>> index a1c01fb..fefa001 100644
>>> --- a/src/compositor.c
>>> +++ b/src/compositor.c
>>> @@ -994,6 +994,8 @@ weston_surface_unmap(struct weston_surface *surface)
>>>       surface->mapped = 0;
>>>       surface->output = NULL;
>>>       wl_list_remove(&surface->layer_link);
>>> +     wl_list_remove(&surface->link);
>>> +     wl_list_init(&surface->link);
>>>
>>>       wl_list_for_each(seat, &surface->compositor->seat_list, link) {
>>>               if (seat->keyboard && seat->keyboard->focus == surface)
>>> --
>>> 1.8.4
>>>
>>> _______________________________________________
>>> 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