[PATCH wayland-protcols v3] unstable: add xdg-toplevel-decoration protocol

Simon Ser contact at emersion.fr
Sun Mar 18 18:59:58 UTC 2018


On March 16, 2018 1:22 PM, Pekka Paalanen <ppaalanen at gmail.com> wrote:
> > > I'm missing a comment that describes what happens if the xdg_toplevel is
> > > destroyed. There is some object dependency here that needs to be stated. Do
> > > we need an event here? Or are we assuming that clients are smart enough to
> > > keep track of destroy events. Either way - needs to be explicitly stated.  
> > 
> > What about requiring clients to destroy the zxdg_toplevel_decoration_v1 before
> > the xdg_toplevel?
> 
> Hi,
> 
> you can, but then you need an error code for clients that get it wrong.
> 
> A common convention is to instead say that zxdg_toplevel_decoration_v1
> becomes "inert" when the associated xdg_toplevel is destroyed. It means
> the object will not send any events, and all requests except destroy
> will be ignored. This approach is often used with racy cases where
> requiring a single order of actions is not possible, and it comes with
> the disadvantage of needing to define what happens if you pass an inert
> object of this type as an argument in some other interface, or if the
> inert object had requests that create more objects.

Thanks for the explanation!

> Both ways are possible. You may want to check how xdg_toplevel deals
> with xdg_surface destruction and how xdg_surface deals with wl_surface
> destruction. Maybe consistency would be the best plan?

The protocol states that: "An xdg_surface must only be destroyed after its role
object has been destroyed". But it doesn't define any error type for protocol
violations. I didn't find anything about the relationship between xdg_surface
and xdg_surface.

So I'm not sure what to do to be consistent with xdg-shell. The options are:
- Become inert
- Send an error on the decoration object
- Automatically destroying the decoration when the toplevel is destroyed?

I'll just go with becoming inert for now. Let me know what you think.

> Thanks,
> pq



More information about the wayland-devel mailing list