On Thu, 31 Mar 2016 17:00:37 -0700
"Jasper St. Pierre" <jstpie...@mecheye.net> wrote:

> wl_registry and wl_registry.bind are about globals and creating new
> instances of globals.
> 
> A compositor can opt to provide a new global interface by using the
> wl_global_create API. Immediately, an event is broadcasted to all
> clients: the wl_registry.global event, which contains a name (the
> uint32_t parameter), an interface (which is a string). If the user
> wants to bind such a global, it passes that back to wl_registry.bind,
> to get an instance of that global.
> 
> Why wasn't the interface used instead? I'm not sure. I imagine it was
> to enforce that binding is done through the global event rather than
> allowing a client to attempt to bind random objects through strings.

It is because you can have multiple globals with the same interface,
e.g. multiple wl_outputs or multiple wl_seats. These are the
non-singleton global interfaces.

Names tell the globals apart when the interface alone would not.


Thanks,
pq

> On Thu, Mar 31, 2016 at 4:48 PM, Yong Bakos <j...@humanoriented.com>
> 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.
> >
> > Thank you,
> > yong

Attachment: pgp27cn366LrM.pgp
Description: OpenPGP digital signature

_______________________________________________
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to