x11rb-protocol
Rust bindings to X11
0.14.0
55M downloads/mo
#1166 most downloaded on crates.io
psychon/x11rb
What this package is like to depend on
Last release 1 months ago
16 Jul 2026
Ships fairly regularly
a new release about every 5 months
Nearly every release is documented
notes for 8 of 8 stable releases
Nothing withdrawn
no release was ever pulled
4 years old
8 releases · first in 2022
2 releases in the last 12 months
see the full history below
Release timeline
8 releases · Jun 2022 to Jul 2026Releases
latest 8-
0.14.016 Jul 2026Release notes
Open source →New features:
- Allow building with libloading 0.9.
Fixes:
- Fix
CUT_BUFFER0toCUT_BUFFER7atom names. The generated code previously usedCUT_BUFFE_R0.
Breaking changes:
- Drop abstract unix socket support, following a change in libxcb.
- MSRV increased to Rust 1.68.
- Update to raw-window-handle 0.6.
Minor changes:
- Pin various dependencies in CI to keep the MSRV check working.
- Fix various new clippy and Rust warnings.
-
0.13.229 Aug 2025Release notes
Open source →New features:
- Update cursor icon file search path to follow a change in libxcb-cursor which in turn was changed to follow libXcursor.
- Get cursor theme name from
$XCURSOR_THEMEif set. - Added
XCBConnection::from_existing_connectionto allow wrapping anything that implementsAsRawXcbConection. Without this function, unsafe code was required from the user. - Added
raw-window-handlefeature which makesXCBConnectionimplementHasRawDisplayHandleandWindowWrapperimplementHasRawWindowHandle. - Use new
hints.mostly-unusedCargo feature. This might improve compilation speed with nightly compilers.
Fixes:
- Fix missing indentation in doc comments in generated code.
- Fix a minor X11 resource leak in cursor code.
- Gate tests behind the features they need so that
cargo test --no-default-featuresworks. This is now also tested in CI. - The
presentfeature depends ondri3to actually work, but this was not specified inCargo.toml.
Breaking changes:
- MSRV increased to Rust 1.64.
Minor changes:
- Various minor changes to fix new compiler and clippy warnings and improve readability.
- Use existing xcursor-rs crate for cursor and cursor theme file parsing instead of own code.
- Updated dependencies to rustix 1.0, gethostname 1.0. This required a MSRV increase to Rust 1.64.
- Pin various dependencies in CI to keep our MSRV check working.
-
0.13.101 May 2024Release notes
Open source →New features:
- Add an
xkbcommon-exampleto showcase use of x11rb together with the xkbcommon crate. - Update from xcb-proto 1.15.2 to 1.17.0. This brings support for PRESENT 1.4 and DRI3 1.4 and fixes some typos in the documentation.
Fixes:
- Macro hygiene:
atom_manager!macro now uses::stdwhen referring to std items.
Breaking changes:
- Optimise
atom_manager!implementation. This changes the contents of the generatedCookiestruct, but there should be no reasons to access these directly. - Remove some unreachable public API from x11rb-async's
StreamAdaptor.
Minor changes:
- Fix new compiler warnings and enable more lints.
- Update dependencies.
- Add an
-
0.13.009 Dec 2023Release notes
Open source →New features:
- A bitmask enum in the generates code has new methods
bits()for conversion to integer andremove()for removing certain bits. - Update our bundled xcb-proto version. This update brings new documentation and support for newer versions of the DPMS and Present extensions.
- Update
$DISPLAYparsing to match new behaviour in libxcb 1.16. - Some variant of
x11rb_protocol::parse_displayis now also available inno_stdmode. - Better error message if
$DISPLAYparsing fails. - Add
Image::into_owned()to get an Image instance with'static. - Change
Image::put()to convert the image to the X11 server's native representation before uploading. - Implement x11rb's
RequestConnectionfor&C,&mut C,Box<C>,Arc<C>,Rc<C>andCow<'_, C>whereC: RequestConnection.
Fixes:
- Fix broken link to x11rb in documentation of x11rb-async.
- Strip leading whitespace from documentation comments in code generator.
- Fix the
dl-libxcbfeature on OpenBSD. There is nolibxcb.so.2on this system and we can simply ask forlibxcb.soto be loaded. - x11rb-async always needed at least tracing 0.1.33, but incorrectly declared compatibility with all 0.1 versions.
Breaking changes:
- Indicate not present properties in x11rb's
WmClass,WmSizeHints, andWmHintshelpers by introducing anOptionin their return value. Previously, missing properties were reported as a parsing error. - Avoid a
Vecin some places in x11rb-protocol by using arrays instead. This affects the return value of a request'sserialize()function, but also some internal code. - Remove unused
read_exact()method in x11rb'sStreamtrait. - Replace use of nix with rustix and implement io-safety. This e.g. means
that some types no longer implement
PartialEqdue to rustix's behaviour. FD passing now usesstd::os::unix::io::OwnedFd. - MSRV was bumped from Rust 1.56 to 1.63 for rustix 0.38.
- Change some functions in
x11rb::rust_connection::stream::DefaultStreamto also return the address that a connection was established to. - Change wrapper types like
WindowWrappernot to require a reference to a connection, but to accept any connection type directly. Due to the new feature mentioned above, this allows to use these wrappers e.g. withArc<C>. - Types in x11rb-protocol now implement less commonly used traits like
PartialEq,Eq,PartialOrd,Ord, andHashonly if the newextra-traitsfeature is enabled. TheDebugimpl only produces the name of the type and not its contents in this case. This change improves compile times of the crate. - Parsing of requests with the
R::try_parse_requestfunction is now gated behind the newrequest-parsingfeature. This change improves compile times.
Minor changes:
- Update dependencies.
- Enable all features when building for docs.rs.
- Fix some lints in examples.
- Change some log calls from info to debug.
- Drop gethostname dependencies on
unixby using rustix instead. - Various changes to please clippy.
- Improve docs front pages.
- A bitmask enum in the generates code has new methods
-
0.12.027 May 2023Release notes
Open source →New features:
- There is a new crate x11rb-async that brings x11rb to the async ecosystem.
- Bitmask enumerations now also implement BitAnd, BitAndAssign and BitOrAssign and offers contains() and intersects() methods.
- Add (optional) support for the
as-raw-xcb-connectioncrate. - Implement Default for
x11rb_protocol::connection::Connection. - Optional support for the
tracingcrate. - New API to convert major + minor opcode of a request to human readable names.
Fixes:
- Improve error message when not all FDs could be sent.
- Use correct byte order on
Image::get()for big-endian servers. - Fix build for
XCBConnectionon architectures withoutAtomicU64.
Breaking changes:
- Various methods on
x11rb_protocol::protocol::xinput::EventForSendnow returnParseErrorinstead of unwrapping errors internally. - The generated names for some structs in
x11rb_protocol::protocol::xkbare now better. For example,SelectEventsAuxBitcase1is now calledSelectEventsAuxNewKeyboardNotify, which at least hints towards its meaning. Image::get()now also returns the visual ID from theGetImageReply.
Minor changes:
- Update dependencies.
- Get rid of some (infallible)
unwrap()s in generated code by moving this to a hand-written helper function. - The usual round of fixing new clippy warnings.
- Remove some unnecessary
unwrap()s in examples. - Use the polling crate in the xclock_utc example.
-
0.11.106 Jan 2023Release notes
Open source →Fixes:
- Fix connection breakage after sending 2^16 requests without a reply.
- Enable features on docs.rs to have better docs.
- Fix dl-libxcb feature on NetBSD not finding libxcb.so.
-
0.11.018 Nov 2022Release notes
Open source →New features:
- All extensions are available in no-std mode.
- Replies and events now implement
Serialize. - Support length expressions in structs in the protocol XML representation.
- Updated to xcb-proto 1.15.2 which brings support for the double buffering extension, dri3 1.3, xfixes 6.0, xinput 2.4, among other things.
x11rb::image::Imagenow implementsClone.
Fixes:
- Fixed a broken link in the documentation.
- The cairo-example now also works under KDE.
Breaking changes:
- Consider use of enums as masks when determining enum sizes and then use our
enum wrappers for mask fields. For example, all values of
xproto::ConfigWindowfit intou8, so previously this was the type used for representing this enumeration. However, it is used as a mask for thevalue_maskfield ofConfigureRequestEvent, which has 16 bits. Thus,ConfigWindowis now represented asu16and thevalue_maskfield ofConfigureRequestEventnow has typeConfigWindow. - Bump MSRV to 1.56 since
once_cellswitched to the 2021 edition.
Minor changes:
- Disable default features of nix crate.
- Deal with warnings from newest clippy.
- Improved unit test code coverage.
- Updated versions of dependencies.
- Switch to 2021 rust edition.
- Speed up
discard_reply()implementation in Rust for cases with many pending replies via a binary search.
-
0.10.012 Jun 2022Release notes
Open source →New features:
- x11rb was split into two crates: x11rb-protocol contains code for working with the X11 protocol, but does not do any X11 I/O. The x11rb crate uses x11rb-protocol to implement an X11 client. This change allows to use x11rb-protocol in other crates without depending on a whole X11 client.
- Lots of new utilities to implement a X11 client in preparation of a possible future x11rb-async. Most of these previously already existed, but were not public. Now, x11rb-protocol makes them available.
- Add traits around requests that allow to send a request in a generic way.
- Implement more traits in the generated code, where possible:
Default,PartialOrd,Ord, andHash. x11rb-protocolcan be used inno_stdmode.- Optional serde support via deriving
serde::Serializeandserde::Deserialize. - Added support for X11 connections over abstract unix sockets.
- Increased the bus factor of the project by about 50%. Welcome @notgull!
Breaking changes:
- Bump MSRV to 1.46 due to the bitflags crate requiring this version. We depend on bitflags through the nix crate.
- Some minor API breakage due to the split into x11rb/x11rb-protocol. For
example,
CreateWindowRequest::send()was previously an associated function and was removed, because a similar feature is available via the new request traits. Also, the API for constructing a resource manager database was changed to remove the need for network I/O from its constructor. A convenience function for the old default behaviour is provided inx11rb.
Minor changes:
- Deal with warnings from newest clippy.
- Remove incorrect documentation for non-present fields from the generated code. This documentation was present because the field value is actually deduced from another field's value, for example the length of a vector.
- Add
#[must_use]to setter methods on*Auxstructs. - Updated to latest versions of dependencies.
- Received FDs now automatically get the
CLOEXECflag applied.