Skip to content

X11: Use x11-dl instead of x11#241

Draft
prokopyl wants to merge 1 commit intomasterfrom
x11-dl
Draft

X11: Use x11-dl instead of x11#241
prokopyl wants to merge 1 commit intomasterfrom
x11-dl

Conversation

@prokopyl
Copy link
Copy Markdown
Member

@prokopyl prokopyl commented May 5, 2026

This PR replaces the x11 crate with its x11-dl counterpart, which allows to dynamically link against the various X11 libraries we depend on.
(Namely: libX11, libGLX, libX11-xcb, libxcb, and probably a few more)

This brings us more in line with the rest of the Rust GUI ecosystem (e.g. winit, glutin, wry all rely on x11-dl rather than x11), as well as a rather big part of the audio plugins ecosystem (most notably, JUCE dynamically loads all Xlib symbols instead of statically linking against libX11).

For us, the biggest improvement is that it allows plugins that use baseview to still function on linux systems that lack one or more X libraries (only GUI creation will fail, which AFAIK most hosts handle gracefully enough).

This PR also fixes an use-after-free bug which could occur if the GLContext outlived its Window (it was using a raw display pointer, now replaced with an Rc to the XcbConnection).
This and related changes also removes quite a few uses of unsafe throughout the library.

@prokopyl prokopyl added this to the v0.1.1 - Updated foundations milestone May 5, 2026
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.

1 participant