XDefaultScreen
This commit is contained in:
parent
42afef8041
commit
97ceb1062d
3 changed files with 9 additions and 0 deletions
|
@ -10,6 +10,7 @@ use crate::ffi;
|
|||
|
||||
use super::cursor::Cursor;
|
||||
use super::event::Event;
|
||||
use super::screen::Screen;
|
||||
use super::visual::Visual;
|
||||
use super::window::Window;
|
||||
|
||||
|
@ -96,6 +97,12 @@ impl Display {
|
|||
Visual { inner: visual }
|
||||
}
|
||||
|
||||
/// Get the default screen using `XDefaultScreen`
|
||||
pub fn get_default_screen(&self) -> Result<Screen> {
|
||||
let screen = unsafe { xlib::XDefaultScreen(self.inner) };
|
||||
Ok(Screen(screen))
|
||||
}
|
||||
|
||||
/// Returns the root window for the given screen.
|
||||
pub fn get_root_window(&self, screen: i32) -> Result<Window> {
|
||||
let inner = unsafe { xlib::XRootWindow(self.inner, screen) };
|
||||
|
|
|
@ -8,6 +8,7 @@ mod drawable;
|
|||
mod event;
|
||||
mod image;
|
||||
mod pixmap;
|
||||
mod screen;
|
||||
mod visual;
|
||||
mod window;
|
||||
|
||||
|
|
1
src/xlib/screen.rs
Normal file
1
src/xlib/screen.rs
Normal file
|
@ -0,0 +1 @@
|
|||
pub struct Screen(pub(super) i32);
|
Loading…
Reference in a new issue