Use libxkbcommon instead of libX11#59
Conversation
|
I don't have access to a Mac but I hope it's pretty straightforward to get it compiling: |
|
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. |
|
That's fixed. I would squash, but just to be clear what I changed. |
|
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. |
|
libspnav just hardcodes the paths: |
|
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. |
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_FLAGSis the only bit of configuration:https://xkbcommon.org/doc/current/group__keysyms.html#gadf335e065050f306ff9094aefa6c9736