Wayland specification doesn't match code generation

Jasper St. Pierre jstpierre at mecheye.net
Wed Sep 3 21:04:12 PDT 2014


The fact that we have an undocumented hack like that in our scanner clearly
isn't great. We need to document it.
On Sep 3, 2014 8:55 PM, "Boyan Ding" <stu_dby at 126.com> wrote:

> Hi,
>
> It is actually not a fault in wayland, instead it is designed to be so.
> new_id's without interface specified in the protocol (such as the one in
> wl_registry::bind) must come with 3 arguments (s: interface name, u:
> version, n: the actual new_id). That's why 'n' turns into 'sun'. If a
> language binding generates the wrong code, please contact the author of
> the language binding and let him correct it. If you are changing how
> wayland-scanner (the official C code generator) works, the whole world
> will break before you.
>
> Refer to "How protocol objects are created" section in [1] to see the
> details.
>
> Regards,
> Boyan Ding
>
> [1]
>
> http://ppaalanen.blogspot.fi/2014/07/wayland-protocol-design-object-lifespan.html
>
> On Wed, 2014-09-03 at 22:32 -0500, Paul Sbarra wrote:
> > I tried to start some discussion on this topic previously, but it
> > apparently didn't make it through the moderator, so I'm trying again
> > having now joined the list.
> >
> >
> > I've recently taken an interest in the gowl implementation of the
> > wayland protocol and noticed that the specification doesn't match the
> > interface that gets generated by the wayland scanner.
> >
> >
> > If I attempt to code-gen gowl using the wayland.xml file the
> > wl_registry bind interface is missing a couple arguments that weston
> > expects, resulting in the following runtime error:
> > libwayland: message too short, object (2), message bind(usun)
> >
> >
> > However, the spec indicates a bind request signature of "un".
> >
> >
> > I tracked this down into some curious logic in the scanner and have
> > been working on a patch to try and allow the corrected signature to be
> > specified in the protocol.  Unfortunately this has become more
> > interesting then I'd anticipated.
> >
> >
> > Attached is my naive attempt at resolving this issue.  I'm horrified
> > by the string->interface lookup and the wl_registry_bind api change
> > but I'm not sure what else one can do.  Any feedback or additional
> > help would be appreciated.
> >
> >
> > Note that this patch applies to the 1.5.91 tagged commit and compiles
> > cleanly (for wayland).  Weston didn't like having the lookup function
> > defined in multiple files, so maybe there would be a better place to
> > put such functionality.
> >
> > Thanks,
> > Paul
> >
> > _______________________________________________
> > wayland-devel mailing list
> > wayland-devel at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/wayland-devel
>
>
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20140903/951a9c12/attachment.html>


More information about the wayland-devel mailing list