Skip to content

Conversation

@cjmayo
Copy link
Contributor

@cjmayo cjmayo commented Oct 23, 2025

I was thinking about how to make libX11 optional as with the other Spacenav components but seeing how it was used swapping for libxkbcommon seemed simpler.

libxkbcommon is a Qt dependency.

This compiles and runs for me - although using Wayland I can't fully test it.

The XKB_KEYSYM_NO_FLAGS is the only bit of configuration:
https://xkbcommon.org/doc/current/group__keysyms.html#gadf335e065050f306ff9094aefa6c9736

@cjmayo
Copy link
Contributor Author

cjmayo commented Oct 23, 2025

I don't have access to a Mac but I hope it's pretty straightforward to get it compiling:

src/ui.cc:29:10: fatal error: 'xkbcommon/xkbcommon.h' file not found
   29 | #include <xkbcommon/xkbcommon.h>

@jtsiomb
Copy link
Contributor

jtsiomb commented Oct 24, 2025

While I don't think there's a huge difference between linking with libX11 (keeping in mind that a connection to an X server is not required for the utility functions we're using), or linking with libxkbcommon, it's probably better to choose the latter, especially if, as you said, libxkbcommon is already a dependency of Qt even on non-X11 platforms.

However if I merge this at this point, we're going from a program usable on macos, to a program broken on macos, until the issue with the include paths is resolved, trivial as it may be. I'm not a macos user either so it would take trial and error on a separate branch with the github CI actions to figure it out. I'll keep the merge request open until I find some time to do that.

@cjmayo
Copy link
Contributor Author

cjmayo commented Oct 24, 2025

That's fixed. I would squash, but just to be clear what I changed.

@jtsiomb
Copy link
Contributor

jtsiomb commented Oct 25, 2025

Thanks, but this only fixes the CI, not the general case. We should probably use pkg-config in the makefile to get the correct paths instead of relying on the user to pass them manually.

@cjmayo
Copy link
Contributor Author

cjmayo commented Oct 25, 2025

@jtsiomb
Copy link
Contributor

jtsiomb commented Oct 26, 2025

Yes but first of all it does so in the makefile, not in the build instructions. So for some set of common environments the build will just work without the user having to worry about paths. And also libspnav does not rely on pkg-config already, so a best effort of adding some common paths to avoid the dependency seems a reasonable tradeoff. Spnavcfg already requires pkg-config to find Qt.

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.

2 participants