Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for libxcb API before version 1.14 #250

Merged
merged 1 commit into from
Feb 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading