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

Call XCloseDisplay instead of xcb_disconnect #184

Merged
merged 1 commit into from
Mar 29, 2024

Conversation

glowcoil
Copy link
Member

Pass false for the should_drop argument of XCBConnection::from_raw_xcb_connection, so that it doesn't implicitly call xcb_disconnect on drop. Instead, explicitly call XCloseDisplay on drop, since the connection was originally created with XOpenDisplay.

@glowcoil glowcoil requested a review from prokopyl March 28, 2024 22:09
Copy link
Member

@prokopyl prokopyl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix looks good to me, although I'm not sure why we're even dealing with XOpenDisplay / XCloseDisplay instead of using XCBConnection::connect()?

I'll merge this now, if we want to make those broader changes we can do so in another PR. 🙂

@prokopyl prokopyl merged commit f5b0c6d into RustAudio:master Mar 29, 2024
3 checks passed
@glowcoil glowcoil deleted the x11-close-display branch March 29, 2024 03:24
@glowcoil
Copy link
Member Author

I'm not sure why we're even dealing with XOpenDisplay / XCloseDisplay instead of using XCBConnection::connect()?

It's necessary since we use the Xlib GLX API for OpenGL context creation. If we were to switch from GLX to EGL, it should be possible to stop linking to Xlib and xcb entirely and just use x11rb's RustConnection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants