[PATCH weston] compositor: init the layer_link after removing it

Kristian Høgsberg hoegsberg at gmail.com
Thu Apr 4 14:42:12 PDT 2013


On Thu, Apr 04, 2013 at 11:24:42PM +0200, Giulio Camuffo wrote:
> Nowhere in Weston. But i thought it was the accepted policy to not have
> around links not initted. But if it not it's no problem.

No, it depends on the link.  In some cases we want to be able to
remove a link without worrying about whether or not it's on a list, in
which case we have to init after remove.  Another case is if we want
to test if an object is on a list or by initing the link when it's not
on a list.  In case of surface->layer_link, we don't do any of those
things.

Kristian

> Giulio
> 
> 
> 2013/4/4 Kristian Høgsberg <hoegsberg at gmail.com>
> 
> > On Thu, Apr 04, 2013 at 11:08:22PM +0200, Giulio Camuffo wrote:
> > > ---
> > >  src/compositor.c | 1 +
> > >  1 file changed, 1 insertion(+)
> >
> > When is this needed?  I don't think we rely on layer_link being valid
> > when a surface is not mapped (not in any layer).
> >
> > Kristian
> >
> > > diff --git a/src/compositor.c b/src/compositor.c
> > > index 3645b04..88f083c 100644
> > > --- a/src/compositor.c
> > > +++ b/src/compositor.c
> > > @@ -977,6 +977,7 @@ weston_surface_unmap(struct weston_surface *surface)
> > >       weston_surface_damage_below(surface);
> > >       surface->output = NULL;
> > >       wl_list_remove(&surface->layer_link);
> > > +     wl_list_init(&surface->layer_link);
> > >
> > >       wl_list_for_each(seat, &surface->compositor->seat_list, link) {
> > >               if (seat->seat.keyboard &&
> > > --
> > > 1.8.2
> > >
> > > _______________________________________________
> > > 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