Skip to content

scanner: export interface should use protected visibility

scanner: export interface should use protected visibility

Many other libraries or frameworks may not pay attention to wayland-scanner parameters such as 'public-code' and 'private-code'. They often use the more common 'public' option, but this can pose a problem and potentially lead to conflicts. Wayland should take measures about this issue.

In nearly every instance, people should use the protected visibility. One noticeable exception is the wayland libraries. They provide the base marshalling protocol that everyone uses, so they exported to others.

Issue in detail: When add a new request in xdg_toplevel, kwin and qtwayland support/use it, but a qt program link to libmpv which depends on libsdl and it still use the old xml file and not compile with the new xml, will cause the new request method not found and crash.

With LD_DEBUG="all" we can find the problem is: the symbol was found in not in qtwayland itself.

This is a symbol replaced issue, we can use:

    __attribute__ ((visibility ("protected")))

to make sure the struct use in our module(qtwayland) is the correct one, not from other library, here the issue symbol is xdg_toplevel_interface.

Signed-off-by: Hongfei Shang

Edited by Hongfei Shang

Merge request reports