Basic API usage
Jan Bruns
code at abnuto.de
Sat Sep 12 11:21:20 UTC 2020
Jan Bruns wrote:
> I've just stumbled upon a more serious question:
>
> registry.bind() doesn't have a version parameter, and also
wl_proxy_add_listener().
>
> Doesn't this mean that an App that doesn't know the latest version of
an interface cannot use libwayland anymore?
>
> 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_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_compositor_create_surface(struct wl_compositor *wl_compositor)
{ // no interface in parameter list
wl_proxy_marshal_constructor(); // not versioned
}
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.
Maybe I've just missed to use some cmd-line switch for wayland-scanner,
but the headers I found in /usr/include of my debian machine also show
exctly this inconsistency.
Gruss
Jan Bruns
More information about the wayland-devel
mailing list