xdg-shell: clarify the relationship of xdg_surface objects and wl_surface roles
[20:23:56] <vyivel> is creating multiple xdg_surface object for the same wl_surface legal?
afaiu yes, but weston (and only weston) says that "xdg_surface must not have any other role"
[20:37:08] <jadahl> vyivel: it's illegal. looking at mutter it should check and deny a client trying to call
get_xdg_surface if there is already an active xdg_surface instance
[20:37:53] <vyivel> got it; right now, wlroots, kwin, and smithay allow it too
[20:38:03] <vyivel> the protocol should explicitly state that, though
[20:38:18] <vyivel> "It is illegal to create an xdg_surface for a wl_surface which already has an assigned role",
but creating an xdg_surface alone doesn't set a role
[20:39:23] <jadahl> sure, makes sense to tweak that wording to make it clear
[20:52:04] <i509vcb> There is the fun issue of creating an xdg_surface and then a layer surface for example.
It should be theoretically illegal per the text of the protocol but I don't recall it being
implemented right anywhere
[20:52:28] <i509vcb> What I recall from that is xdg_surface assigns a sort of pseudo role
[21:00:19] <jadahl> i509vcb: yea, creating an xdg_surface without also later creating a role object using
xdg_surface makes no sense
Specifically, cases which need to be clarified in the protocol are
- Multiple
xdg_surface
objects created with the samewl_surface
- An
xdg_surface
created for awl_surface
, destroyed, and a role which doesn't extendxdg_surface
(e.g.wl_subsurface
) is assigned to saidwl_surface
- "While xdg_surface itself is not a role, the corresponding surface may only be assigned a role extending xdg_surface, such as xdg_toplevel or xdg_popup"; does this restriction apply beyond an
xdg_surface
's lifetime?
- "While xdg_surface itself is not a role, the corresponding surface may only be assigned a role extending xdg_surface, such as xdg_toplevel or xdg_popup"; does this restriction apply beyond an
My preferred way to fix this would be to state that xdg_surface
is a wl_surface
role, which needs its own role to function properly; however, this doesn't sound like a backwards-compatible change.