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

Allow the creation of XConnection using an existing connection handle? #667

Open
iptq opened this issue Sep 30, 2018 · 2 comments
Open

Allow the creation of XConnection using an existing connection handle? #667

iptq opened this issue Sep 30, 2018 · 2 comments
Labels
DS - x11 H - help wanted Someone please save us S - api Design and usability

Comments

@iptq
Copy link

iptq commented Sep 30, 2018

I'm using glutin which exports many functions from this crate. I already have a connection open to X and I'd like to share my connection with winit; would it be a good idea to add a constructor to XConnection that takes in an existing *mut xlib::Display?

EDIT: just peeked into the code and noticed that a Mutex was already used for X11_BACKEND before XConnection::new is called so this might actually be a bit more complicated..

@francesca64 francesca64 added H - help wanted Someone please save us DS - x11 S - api Design and usability labels Oct 28, 2018
@francesca64
Copy link
Member

Sorry for the delay! The X11_BACKEND mutex shouldn't really be a problem, since it will never be used before an EventsLoop is constructed. It does make it a bit more work to implement this, though.

I haven't looked into all the correctness/etc. concerns with sharing a connection, but at face value, I'm not opposed to an EventsLoopExt constructor being added for this.

@notgull
Copy link
Member

notgull commented Aug 13, 2023

It would be nice to be able to "bring your own connection". Right now this crate just uses Xlib, but I'm working on making it so most functionality takes places over an x11rb Connection. If I can make it so all functionality takes place over the Connection, then it should be possible to just pass in an impl Connection to run the X11 backend over whatever you want.

In practice there are two main obstacles to this:

  • The Connection trait isn't stable. See API Stability psychon/x11rb#840 for more information.
  • By default we want to use an Xlib connection to keep compatibility with GLX.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DS - x11 H - help wanted Someone please save us S - api Design and usability
Development

No branches or pull requests

3 participants