<div dir="ltr"><div><div>I agree it's a hack, but it's also one that invalidates the protocol specification. If the wire protocol requires four arguments then the specification needs to reflect that. Currently if another tool or protocol implementation (like the gowl example previously mentioned) attempts to generate code from the specification they end up code that is not compatible with libwayland applications. In my opinion that's a pretty bad outcome for a hack, documented or not.<br>
<br></div>Attached is a patch that resolves the problem (at least it limits the scope of the hack to the wayland code generator) while maintaining the existing api. Thank you in advance for reviewing and considering this patch.<br>
<br></div>Paul<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Sep 3, 2014 at 11:04 PM, Jasper St. Pierre <span dir="ltr"><<a href="mailto:jstpierre@mecheye.net" target="_blank">jstpierre@mecheye.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">The fact that we have an undocumented hack like that in our scanner clearly isn't great. We need to document it.</p>
<div class="HOEnZb"><div class="h5">
<div class="gmail_quote">On Sep 3, 2014 8:55 PM, "Boyan Ding" <<a href="mailto:stu_dby@126.com" target="_blank">stu_dby@126.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
It is actually not a fault in wayland, instead it is designed to be so.<br>
new_id's without interface specified in the protocol (such as the one in<br>
wl_registry::bind) must come with 3 arguments (s: interface name, u:<br>
version, n: the actual new_id). That's why 'n' turns into 'sun'. If a<br>
language binding generates the wrong code, please contact the author of<br>
the language binding and let him correct it. If you are changing how<br>
wayland-scanner (the official C code generator) works, the whole world<br>
will break before you.<br>
<br>
Refer to "How protocol objects are created" section in [1] to see the<br>
details.<br>
<br>
Regards,<br>
Boyan Ding<br>
<br>
[1]<br>
<a href="http://ppaalanen.blogspot.fi/2014/07/wayland-protocol-design-object-lifespan.html" target="_blank">http://ppaalanen.blogspot.fi/2014/07/wayland-protocol-design-object-lifespan.html</a><br>
<br>
On Wed, 2014-09-03 at 22:32 -0500, Paul Sbarra wrote:<br>
> I tried to start some discussion on this topic previously, but it<br>
> apparently didn't make it through the moderator, so I'm trying again<br>
> having now joined the list.<br>
><br>
><br>
> I've recently taken an interest in the gowl implementation of the<br>
> wayland protocol and noticed that the specification doesn't match the<br>
> interface that gets generated by the wayland scanner.<br>
><br>
><br>
> If I attempt to code-gen gowl using the wayland.xml file the<br>
> wl_registry bind interface is missing a couple arguments that weston<br>
> expects, resulting in the following runtime error:<br>
> libwayland: message too short, object (2), message bind(usun)<br>
><br>
><br>
> However, the spec indicates a bind request signature of "un".<br>
><br>
><br>
> I tracked this down into some curious logic in the scanner and have<br>
> been working on a patch to try and allow the corrected signature to be<br>
> specified in the protocol. Unfortunately this has become more<br>
> interesting then I'd anticipated.<br>
><br>
><br>
> Attached is my naive attempt at resolving this issue. I'm horrified<br>
> by the string->interface lookup and the wl_registry_bind api change<br>
> but I'm not sure what else one can do. Any feedback or additional<br>
> help would be appreciated.<br>
><br>
><br>
> Note that this patch applies to the 1.5.91 tagged commit and compiles<br>
> cleanly (for wayland). Weston didn't like having the lookup function<br>
> defined in multiple files, so maybe there would be a better place to<br>
> put such functionality.<br>
><br>
> Thanks,<br>
> Paul<br>
><br>
> _______________________________________________<br>
> wayland-devel mailing list<br>
> <a href="mailto:wayland-devel@lists.freedesktop.org" target="_blank">wayland-devel@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
<br>
<br>
<br>
_______________________________________________<br>
wayland-devel mailing list<br>
<a href="mailto:wayland-devel@lists.freedesktop.org" target="_blank">wayland-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
</blockquote></div>
</div></div></blockquote></div><br></div></div>