Skip to content

Conversation

@blobfish
Copy link
Contributor

@blobfish blobfish commented Jan 7, 2026

vsgViewerWayland

    Comment out unused function parameters
    Add missing wm_capabilities function pointer to xdg_toplevel_listener
    Add missing axis_relative_direction function pointer to wl_pointer_listener
    Add missing axis_value120 function pointer to wl_pointer_listener
@VasanthBalguri
Copy link

Hi Blobfish,

Thanks for these fixes and giving it a try, I want to ask if you have faced any performance issues while resizing window? Any other feedback is appreciated...

@VasanthBalguri
Copy link

Hi @blobfish ,

When I tired to build I ma getting followig error:

[ 97%] Building CXX object src/vsg/CMakeFiles/vsg.dir/platform/wayland/Wayland_Window.cpp.o
In file included from /home/vasanth/practice/VulkanSceneGraph-personal/src/vsg/platform/wayland/Wayland_Window.cpp:4:
/home/vasanth/practice/VulkanSceneGraph-personal/include/vsg/platform/wayland/Wayland_Window.h:91:71: error: ‘const wl_pointer_listener’ has no non-static data member named ‘axis_value120’
91 | .axis_relative_direction = pointer_axis_relative_direction};
| ^
/home/vasanth/practice/VulkanSceneGraph-personal/include/vsg/platform/wayland/Wayland_Window.h:175:67: error: ‘const xdg_toplevel_listener’ has no non-static data member named ‘wm_capabilities’
175 | .wm_capabilities = xdg_toplevel_handle_wm_capabilities};
|

I can see that following apis are not compatible with my system:
wm_capabilities, axis_value120 and axis_relative_direction

Is seems like some new apis are added in later versions, we need to find a mechanism which can identify the target version of the wayland and compile accordingly, this seems more work than what I initially anticipated :(

Or for time being we can drop these apis for now and ignore the warnings.

@blobfish you can give following a try:

void WaylandRegistryState::registry_add_object(void *data, struct wl_registry *registry, uint32_t id, const char *interface, uint32_t version) {
WaylandRegistryState state = static_cast<WaylandRegistryState>(data);
std::cout << "Interface: "<< interface << " Version: " << version <<std::endl;

this will output the capabilities of the wayland in your system and its version

@robertosfield other than that I see no issues with this changes, you can take a call here...

@robertosfield
Copy link
Collaborator

@VasanthBalguri could you provide changes you had to make to get things to compile.

I presume we'll need to pass in the API version of wayland, collected from our CMake scripts, or use the wayland headers to decide whether to compile in the newer APIs. I'm not familiar with wayland so can't say what approach would be best.

@blobfish
Copy link
Contributor Author

I was afraid of that. The wayland header files do a good job of describing the struct members protocol revision history, but I couldn't map that to any library revision. I couldn't find any useful #defines in either the system headers or the generated headers. I don't know how to conditional compile for wayland. For now, the simplest thing to do is just revert the change for the warnings.

IMHO: Wayland Ignorant:
I am getting the impression that baking in all the handlers at compile time is not 'how you do it'. We are jumping through a bunch of hoops just trying to silence warnings. Thinking we could zero initialize some structs at compile time and set the desired handlers at run time using introspection if needed/possible.

@VasanthBalguri
Copy link

VasanthBalguri commented Jan 16, 2026 via email

@robertosfield
Copy link
Collaborator

Would it be possible to just query at runtime for the Wayland libraries and functions using dlopen and dlsym?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants