Basic API usage

Simon Ser contact at emersion.fr
Sat Sep 12 11:32:24 UTC 2020


Hi,

On Saturday, September 12, 2020 1:21 PM, Jan Bruns <code at abnuto.de> wrote:

> > How to tell libwayland to not attempt to call nonexisting callbacks?
>
> Well, libwayland of course has some work around this issue (there's a
> versioned mashalling function that should apply the version to the
> new-id arg).
>
> But it doesn't make much use of this on it's own...
>
> After failing to identify a make-target suitable for compiling
> scanner.c, and spending an hour or so on a failed try to find a manual
> cmd-line for debian's pimary C-compiler to do that, I didn't find the
> time to investigate about this strange auto-generated code inconsistency:
>
> wl_display_get_registry(struct wl_display *wl_display)
> {  // no interface in parameter list
>    wl_proxy_marshal_constructor(); // not versioned
> }

wl_display version is hardcoded to 1, because the client retrieves it
before version negociation can happen.

> wl_registry_bind(struct wl_registry *wl_registry, uint32_t name, const
> struct wl_interface *interface, uint32_t version)
> { // with interface in parameter list
>   wl_proxy_marshal_constructor_versioned(name, interface->name,
> version); // passes a 3rd (ignored?) wire argument
> }

wl_registry_bind lets the client specify the version they want to bind
to.

> wl_compositor_create_surface(struct wl_compositor *wl_compositor)
> { // no interface in parameter list
>   wl_proxy_marshal_constructor(); // not versioned
> }

wl_surface inherits its version from wl_compositor.

For more info:
https://wayland.freedesktop.org/docs/html/ch04.html#sect-Protocol-Versioning

> To me this looks like the generated C code would frequently make use of
> unspecified interface versions, so that distro-maintainers would have to
> intensively take care about the exact version in use for any single app
> that makes use of libwayland-client, if he'd like to avoid random
> app-shutdowns due to calls to random pointers (and/or compilation
> errors) in addition to upstreaming recompiled versions for any such app.

I don't know if it's just me, but your e-mails sound like rants and
aren't making it very appealing for people to reply to. I think Pekka
is being very patient and helpful here, and I'd appreciate if you could
phrase your emails slightly differently. It's completely normal to
not understand everything when you're getting to know something new.
Thanks.


More information about the wayland-devel mailing list