1
0
Fork 0
baseview/src/x11/xcb_connection.rs

16 lines
426 B
Rust
Raw Normal View History

2020-05-31 14:29:32 -04:00
/// A very light abstraction around the XCB connection.
///
/// Keeps track of the xcb connection itself and the xlib display ID that was used to connect.
pub struct XcbConnection {
pub conn: xcb::Connection,
pub xlib_display: i32,
}
impl XcbConnection {
pub fn new() -> Self {
let (conn, xlib_display) = xcb::Connection::connect_with_xlib_display().unwrap();
Self { conn, xlib_display }
}
}