-
Notifications
You must be signed in to change notification settings - Fork 50
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
Find some way to support pure-Rust Wayland and X handles #120
Comments
I originally suggested something like this in #94, although its usefulness would be limited since it can't really be used in hardware acceleration... although maybe it could be used in The question then becomes "how do we get the The way I would prefer, from a |
Between this and #102, it makes me wonder if there is a niche in the ecosystem for a more opinionated window handle type. Maybe an enum between the "raw" window handle defined in this crate (maybe even the |
My current stance is that this library should only expose the C window handles accepted by OpenGL and Vulkan. Other handles should be passed through other methods. Closing for now. |
Somewhat related: In #134 we're doing exactly this, exposing a pure Rust handle, without a stable ABI. So we could probably adapt the same solution to this. |
I would argue that #134 is an extenuating circumstance, since there are no other good ways to pass your canvas object to the underlying graphics APIs. Even the data attribute hack can only accommodate types currently registered in the DOM. So our hand is forced into exposing My stance on pure Rust desktop handles is the same as above. The expense of keeping pointers to them is greater than the possible benefits of letting |
Yeah I probably exaggerated above, but I do think they share similarities, and that the solution we choose for
Well, we're never forced, we could also take the choice you've done for this issue, and just... Not support web handles at all, until they get a stable ABI that we can use. But nobody wants that, and so we take another route ;) |
The core issue is that On the other hand, the graphics APIs as they are currently exposed to Rust take It might be nice to have some kind of other, broader crate with a more expansive window handle type, for crates that don't wrap around graphics APIs. But for a lot of existing crates that use |
Makes sense. I'll leave this open anyhow until we figure out #134, but will probably close it after that. |
For pure-Rust connections, there is no XCB connection that can be passed into the display constructor. Thus, this PR enables the display to be created without needing an XCB or Xlib handle, by providing `None` in the constructor. cc rust-windowing/raw-window-handle#120 Signed-off-by: John Nunley <dev@notgull.net>
For pure-Rust connections, there is no XCB connection that can be passed into the display constructor. Thus, this PR enables the display to be created without needing an XCB or Xlib handle, by providing `None` in the constructor. cc rust-windowing/raw-window-handle#120 Signed-off-by: John Nunley <dev@notgull.net>
As of rust-windowing/softbuffer#171 softbuffer can create a context and run without a C connection. This issue was discussed in our weekly winit maintainer's meeting and it was decided that it's out of scope for |
Both wayland-rs and x11rb have pure-Rust backends that don't require C libraries for X or Wayland. But to use
raw-window-handle
it's necessary to use xcb/xlib/libwayland to have a pointer to put in the display and window handle.Are there any good ways to support this? It could be supported with feature flags that pull in x11rb and wayland-rs as dependencies, but that is a bit problematic in terms of API stability.
This would generally be limited to software rendering (such as with softbuffer) since the EGL and Vulkan WSI implementations are written in C and use these C libraries. So its usefulness would be limited, but it would be nice to have.
The text was updated successfully, but these errors were encountered: