arguments of wl_registry.bind

Pekka Paalanen ppaalanen at gmail.com
Fri Feb 24 09:11:25 UTC 2017


On Sat, 18 Feb 2017 13:26:15 +0200
me at beroal.in.ua wrote:

> Hello. IMHO, I found a bug in the Wayland protocol description. It 
> pertains to arguments of wl_registry.bind. The protocol description
> 
> https://cgit.freedesktop.org/wayland/wayland/tree/protocol/wayland.xml
> 
> says that there are the following arguments. {{{
>        <arg name="name" type="uint" summary="unique numeric name of the 
> object"/>  
>        <arg name="id" type="new_id" summary="bounded object"/>
> }}}
> 
> However, the function "wl_registry_bind" in 
> "/usr/include/wayland-client-protocol.h" (I guess that the file is 
> generated) executes a call {{{
> wl_proxy_marshal_constructor_versioned((struct wl_proxy *) wl_registry,
>               WL_REGISTRY_BIND, interface, version, name, 
> interface->name, version, NULL)
> }}}.
> So the actual arguments of wl_registry.bind are [name, interface->name, 
> version, id].
> 
> Indeed, testing with "kwin" revealed that:
> - sending [("uint", 5), ("uint", 3)] returns an error "invalid arguments 
> for wl_registry at 2.bind",
> - sending [("uint", 5), ("string", b'wl_seat'), ("uint", 4), ("uint", 
> 3)] works as expected,
> where 5 is the name of wl_seat which the server communicated before, 3 
> is a free client-side object identifier.
> So the Wayland protocol description "wayland.xml" is incorrect. Am I right?

No, it is all intentional, and cannot work otherwise.

https://wayland.freedesktop.org/docs/html/ch04.html#sect-Protocol-Wire-Format
seems to be missing the special-casing, but I have explained it here:
http://ppaalanen.blogspot.fi/2014/07/wayland-protocol-design-object-lifespan.html
section "How protocol objects are created".

If you look at the wayland-scanner sources, you see that this special case
is deliberate.


Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20170224/b3197ede/attachment.sig>


More information about the wayland-devel mailing list