diff options
Diffstat (limited to 'src/safe_x11/mod.rs')
-rw-r--r-- | src/safe_x11/mod.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/safe_x11/mod.rs b/src/safe_x11/mod.rs index 2e368aa..9e5859a 100644 --- a/src/safe_x11/mod.rs +++ b/src/safe_x11/mod.rs @@ -78,10 +78,8 @@ impl<'a> fmt::Display for XSafeError<'a> { /// pub fn open_display(display: &str) -> Result<*mut Display, XSafeError> { let d = if display == "" { - println!("Opening default display"); unsafe { xlib::XOpenDisplay(0x0 as *const i8) } } else { - println!("Opening {}", display); let cstr = try!(CString::new(display)); unsafe { xlib::XOpenDisplay(cstr.as_ptr()) } }; @@ -121,6 +119,10 @@ pub fn screen_size(display: *mut Display) -> (u32, u32) { (dw, dh) } +pub fn root_window(display: *mut Display) -> Window { + unsafe { xlib::XDefaultRootWindow(display) } +} + /// Grab pointer buttons. /// /// # Example @@ -159,7 +161,6 @@ pub fn grab_button(display: *mut Display, button: u32, modifiers: u32, /// pub fn grab_key(display: *mut Display, key: u32, modifiers: u32, owner_events: bool, pointer_mode: i32, keyboard_mode: i32) { - println!("Modifiers {:x}", modifiers); unsafe { let default_win = xlib::XDefaultRootWindow(display); let keycode: i32 = xlib::XKeysymToKeycode(display, key as u64) as i32; |