Skip to content
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

Enable creating an X11 display without connection #171

Merged
merged 3 commits into from
Nov 2, 2023

Conversation

notgull
Copy link
Member

@notgull notgull commented Nov 1, 2023

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

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 <[email protected]>
@notgull notgull requested a review from ids1024 November 1, 2023 03:02
Signed-off-by: John Nunley <[email protected]>
@ids1024
Copy link
Member

ids1024 commented Nov 1, 2023

So if this were used along with winit (with a version of winit that uses x11rb without the xcb feature), there would be two sockets to the X server? Theoretically that seems unnecessary, but isn't really a problem and should work fine with X. That is probably better than exposing the version of x11rb in the public API.

Something like this wouldn't be possible with Wayland though.

The implementation is fairly straightforward, but it would be good to have some way to test this. And this still depends on xcb? I guess if the goal is to accommodate pure-Rust connections, we should use pure x11rb here, and have xcb dependencies/features behind a default feature flag?

@notgull
Copy link
Member Author

notgull commented Nov 1, 2023

The implementation is fairly straightforward, but it would be good to have some way to test this.

Yes, I'll add a test case.

And this still depends on xcb? I guess if the goal is to accommodate pure-Rust connections, we should use pure x11rb here, and have xcb dependencies/features behind a default feature flag?

Probably best for another PR, for bisection purposes.

Signed-off-by: John Nunley <[email protected]>
@notgull notgull requested a review from john01dav as a code owner November 2, 2023 02:48
@notgull notgull merged commit c2ec494 into master Nov 2, 2023
39 checks passed
@notgull notgull deleted the notgull/no-display branch November 2, 2023 05:26
@notgull notgull mentioned this pull request Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants