RustAudio / baseview

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

Switch from xcb crate to x11rb #173

Closed glowcoil closed 3 months ago

glowcoil commented 3 months ago

Replace the xcb and xcb-util crates with x11rb. We were using an old version of the xcb crate which had some soundness issue. x11rb doesn't have these issues and generally provides a safer and nicer to use API.

It's possible to use x11rb without linking to xcb at all, using the RustConnection API, but unfortunately we have to use the XCBConnection API (which uses xcb under the hood) due to our use of the xlib GLX API for creating OpenGL contexts. In the future, it might be possible to avoid linking to xlib and xcb by replacing GLX with EGL.

Getting the xlib-xcb integration to work also necessitated upgrading the version of the x11 crate, since the version we were using was missing some necessary functionality that was previously being provided by the xcb crate.