-
Notifications
You must be signed in to change notification settings - Fork 5
X11 New Technology #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: new-keyboard-linux
Are you sure you want to change the base?
Conversation
03f12db
to
e6ad0fb
Compare
I just discovered this and would like to point that it would be amazing if a switch to x11rb is successful. |
It would make no difference since we would still link to libxcb dynamically. |
I thought that dynamically linking to libxcb is not necessary for x11rb to work, but a feature. Does winit need this feature? Or am I having some other misconceptions here? Sorry for my naivety on this topic. |
I suppose you are right. Though for now we had no plans to expose this feature. Furthermore we would still dlopen other libraries such as xkbcommon. Most significantly, you would not be able to simply use accelerated rendering via opengl/vulkan in this case. It would still be possible to do accelerated rendering by using the low level kernel apis directly for presentation, but this would require quite a bit of linux-specific code (and might not work with the properietary nvidia drivers.) |
I don't know enough about this, but I was hoping that x11rb would at least be a step in the right direction of support musl. I guess xkbcommon can't be replaced (unless somebody RIIR) and I don't know anything about the handle that is needed by something like wgpu to use it for OpenGL/Vulkan to even guess at solution to that. So at the end it will have to be statically linked for musl I'm assuming. It would be great if somebody knowledgeable about this drops a comment on what's necessary to get winit going on musl in rust-windowing#1818 so even somebody like me can contribute towards it. |
Given there may be environments where X11 doesn't even exist (Wayland only with no XWayland), I would assume dlopen is the ideal solution here |
Keep in mind that drivers are usually opened via dlopen. If you wanted to avoid this, you would have to statically link drivers for all graphics cards that you want to support. |
I was asking myself already how this is supposed to be handled with a musl library. I don't know, I guess there would have to be a separate mechanism to detect if X11 or Wayland is the preferred DE.
I'm not entirely sure what that means. For example Vulkan can be statically linked, see ash-rs/ash#457 for example. I am unaware of having to link drivers for each graphics card. |
libvulkan.so is merely a proxy that loads the actual driver at runtime with dlopen: https://github.com/KhronosGroup/Vulkan-Loader/blob/77f3ea476ec0636c34dfd141e96be64173d96977/loader/vk_loader_platform.h#L252 |
That's good to know. So I guess it is impossible to make a graphical app on the musl target? |
I suppose it would be possible on alpine where musl is linked dynamically. |
Apparently I had a wrong impression of things then. Thank you so much for enlightening me! |
e6ad0fb
to
9be37b0
Compare
Over the past few months I've been working on a wayland compositor [1]. Similarly to what people have expressed in this issue, I wanted the same binary to work on pure wayland systems and on systems with X available. Therefore linking to libxcb was not acceptable for me. In the end I decided to roll my own pure rust X client instead of using x11rb since x11rb had no support for async programming. But since winit does not make use of async that shouldn't matter for winit. Long story short I've come around to seeing the value in pure-rust winit applications. I'm no longer opposed to porting my branch to x11rb. @psychon has already shown above that it should not be too hard to go through the code and simply replace the xcb calls with the equivalent x11rb calls. That being said, since I'm no longer using X myself, I probably won't do it myself. If you have any questions while doing the port feel free to ask me about it. |
7d59987
to
ba8023a
Compare
0676c39
to
6c7820e
Compare
cargo fmt
has been run on this branchcargo doc
builds successfullyCHANGELOG.md
if knowledge of this change could be valuable to usersThis is a work in progress. I'll comment in the upstream issue.