[PATCH wayland-protocols v4] unstable: add xdg-toplevel-decoration protocol

Simon Ser contact at emersion.fr
Tue Apr 17 21:37:48 UTC 2018

(Re-sending the message because I forgot to reply to the list)

On April 13, 2018 2:56 PM, Jonas Ã…dahl <jadahl at gmail.com> wrote:
> Another thing to consider is whether non-toplevels ever want a similar
> kind of protocol? It is not something we need to go into much further
> details now, but it would be easy to add into this protocol by just
> renaming the directory under unstable/ and the XML file to
> "xdg-decorations" or something. Would we have another type of surface
> that needs similar functionality, we could add that as a separate pair
> of interfaces.

I'm not sure it's a good idea to add decorations to non-toplevel surfaces. I
can't think of a use-case for popups. We don't know yet what kind of
xdg-surface will be added later, so I think we can't really design a protocol
that would work for this unknown use-case and we'd better create a new protocol

> Is this the consensus as well? Because if it should be possible, there
> are those things I mentioned to consider regarding capabilities. A
> potential mode could for example be to outsource drawing shadow or
> something.

As Drew, I think the complexity isn't worth it. Compositors wanting to draw
shadows around clients will get into more issues (e.g. getting the shape of the

> Ignoring that for a bit, I guess the reason for allowing the compositor
> to disregard the set mode to be that a client might not know whether
> request ssd or csd? Especially in the example you gave above. Then what
> is the purpose of the set_mode request at all?

The set_mode request allows the client to communicate its preference, but still
allow the compositor to override it. For instance, a GTK+ client with a titlebar
containing widgets might prefer CSD, but could still accept to use SSD by
turning the titlebar into a toolbar.

That would work well in tiling compositors when moving a window between a tiled
container and a floating container: the compositor could accept the set_mode
request in floating mode and enforce SSD in tiled mode. We could imagine another
compositor letting clients decorate themselves if they want to in tiled mode,
in which case the compositor would send preferred_mode events when switching
between tiled and floating containers.

More information about the wayland-devel mailing list