On Sat, 18 Feb 2017 13:26:15 +0200 [email protected] 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 [email protected]", > - 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
pgpG27JPk8LUg.pgp
Description: OpenPGP digital signature
_______________________________________________ wayland-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/wayland-devel
