RustAudio / baseview

low-level window system interface for audio plugin UIs
Apache License 2.0
259 stars 54 forks source link

Call XCloseDisplay instead of xcb_disconnect #184

Closed glowcoil closed 3 months ago

glowcoil commented 3 months ago

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 commented 3 months ago

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.