diff options
Diffstat (limited to 'src/x/connection.rs')
| -rw-r--r-- | src/x/connection.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/x/connection.rs b/src/x/connection.rs index d9ed9ca..78e721d 100644 --- a/src/x/connection.rs +++ b/src/x/connection.rs @@ -7,11 +7,9 @@ use xcb::x::{ Atom, InternAtom }; pub struct Connection(xcb::Connection); impl Connection { - pub fn connect(display_name: Option<&str>) - -> xcb::ConnResult<(Connection, i32)> - { + pub fn connect() -> xcb::ConnResult<(Connection, i32)> { let (connection, screen_index) - = xcb::Connection::connect(display_name)?; + = xcb::Connection::connect_with_xlib_display()?; Ok((Connection(connection), screen_index)) } @@ -91,6 +89,10 @@ pub trait ConnectionExt: HasConnection { wm_strut, wm_strut_partial, }) } + + fn get_xlib_display(&self) -> *mut x11::xlib::Display { + self.connection().0.get_raw_dpy() + } } impl<T: HasConnection> ConnectionExt for T { } |