On Thu, Mar 31, 2016 at 06:48:06PM -0500, Yong Bakos wrote: > Hi, > I've been investigating the semantics of the name parameter within the > wl_registry interface, prompted by a recent dialog regarding my patch of arg > summary attributes in wayland.xml. > > I've dug around the Weston source to see what values are passed as the name > argument, and where it goes... and I'm at a bit of a loss. This argument is > always an integer, and seems like it's just passed around and never even used > for anything! I feel like I must be missing something, hence this question: > what is this `name` argument in wl_registry_bind, wl_registry_send_global, > and wl_registry_send_global_remove? Why is it called name when it is merely a > numeric identifier? Shouldn't it be called `id`? > > I'd love to see where this argument is used within the weston source, so if > you know a file:line you can point me to, I'll add one beer to your queue. >
Each global object has a unique "name" used for identifying them. There may be multiple objects of the same interface, but they'll all have unique names. For example there may be multiple wl_output's and multiple wl_seat's, all with different "names". When the client binds a global, it will pass the "name" (the uint32_t identifier) so that the server can know which of the globals it tries to bind. Just an interface name would not be enough because, as I mentioned, there may be multiple globals with the same interface, but the client is binding just one of the advertised globals. You are not finding the use of "name" anywhere in the weston source code because the registry is implemented in libwayland-server.so. See registry_bind() in wayland-server.c. I can't say for sure the reason behind using "name", but using "id" would potentially be confused with the object "id"'s. Jonas > Thank you, > yong > > > _______________________________________________ > wayland-devel mailing list > [email protected] > https://lists.freedesktop.org/mailman/listinfo/wayland-devel _______________________________________________ wayland-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/wayland-devel
