Skip to content

Commit

Permalink
Merge pull request #250 from acpiccolo/version
Browse files Browse the repository at this point in the history
Add support for libxcb API before version 1.14
  • Loading branch information
rtbo authored Feb 4, 2024
2 parents e9e3bed + e1363b2 commit 7e3a041
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ optional = true
features = ["xlib"]

[features]
default = ["libxcb_v1_14"]
debug_atom_names = []
xlib_xcb = ["x11/xlib"]
libxcb_v1_14 = []

composite = [ "xfixes" ]
damage = [ "xfixes" ]
Expand Down
6 changes: 6 additions & 0 deletions src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1754,6 +1754,9 @@ impl Connection {
///
/// This retrieves the total number of bytes read from this connection,
/// to be used for diagnostic/monitoring/informative purposes.
///
/// Since: libxcb 1.14
#[cfg(feature = "libxcb_v1_14")]
pub fn total_read(&self) -> usize {
unsafe { xcb_total_read(self.c) as usize }
}
Expand All @@ -1764,6 +1767,9 @@ impl Connection {
///
/// This retrieves the total number of bytes written to this connection,
/// to be used for diagnostic/monitoring/informative purposes.
///
/// Since: libxcb 1.14
#[cfg(feature = "libxcb_v1_14")]
pub fn total_written(&self) -> usize {
unsafe { xcb_total_written(self.c) as usize }
}
Expand Down
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,11 @@
//! have side effects (`x::GetAtomName` requests) which can sometimes not be desirable.
//! The feature should therefore only be activated when needed.
//!
//! ## `libxcb_v1_14`
//!
//! This feature is enabled by default and activates the libxcb API version 1.14.
//! To use a version of the libxcb API prior to 1.14, you must disable it.
//!
//! ## Extension features
//!
//! The following X extensions are activated by a cargo feature:
Expand Down

0 comments on commit 7e3a041

Please sign in to comment.