screen
This commit is contained in:
parent
97ceb1062d
commit
5387a0f543
2 changed files with 6 additions and 5 deletions
|
@ -92,8 +92,8 @@ impl Display {
|
|||
}
|
||||
|
||||
/// Gets the default visual
|
||||
pub fn default_visual(&self, screen: i32) -> Visual {
|
||||
let visual = unsafe { xlib::XDefaultVisual(self.inner, screen) };
|
||||
pub fn default_visual(&self, screen: &Screen) -> Visual {
|
||||
let visual = unsafe { xlib::XDefaultVisual(self.inner, screen.0) };
|
||||
Visual { inner: visual }
|
||||
}
|
||||
|
||||
|
@ -104,8 +104,8 @@ impl Display {
|
|||
}
|
||||
|
||||
/// 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) };
|
||||
pub fn get_root_window(&self, screen: &Screen) -> Result<Window> {
|
||||
let inner = unsafe { xlib::XRootWindow(self.inner, screen.0) };
|
||||
if inner == 0 {
|
||||
return Err(Error::GetWindowError);
|
||||
}
|
||||
|
|
|
@ -29,7 +29,8 @@ impl<'a> Window<'a> {
|
|||
Some(parent) => parent,
|
||||
None => display.get_default_root_window()?,
|
||||
};
|
||||
let visual = display.default_visual(0);
|
||||
let screen = display.get_default_screen()?;
|
||||
let visual = display.default_visual(&screen);
|
||||
let window = unsafe {
|
||||
xlib::XCreateWindow(
|
||||
display.as_raw(),
|
||||
|
|
Loading…
Reference in a new issue