diff --git a/src/lib.rs b/src/lib.rs index f8725b52..061f85af 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -23,7 +23,8 @@ mod x11; mod events; mod hints; -pub struct MonitorID(uint); +/// Identifier for a monitor. +pub struct MonitorID(winimpl::MonitorID); /// Represents an OpenGL context and the Window or environment around it. /// @@ -85,7 +86,12 @@ impl Window { hints: &Hints, monitor: Option) -> Result { + // extracting the monitor ID + let monitor = monitor.map(|id| { let MonitorID(id) = id; id }); + + // creating the window let win = try!(winimpl::Window::new(dimensions, title, hints, monitor)); + Ok(Window{ window: win, nosend: std::kinds::marker::NoSend, diff --git a/src/win32/mod.rs b/src/win32/mod.rs index 65374b76..a5df94cf 100644 --- a/src/win32/mod.rs +++ b/src/win32/mod.rs @@ -2,7 +2,7 @@ use std::kinds::marker::NoSend; use std::sync::Mutex; use std::sync::atomics::AtomicBool; use std::ptr; -use {Event, Hints, MonitorID}; +use {Event, Hints}; mod event; mod ffi; @@ -17,6 +17,8 @@ pub struct Window { nosend: NoSend, } +pub struct MonitorID(uint); + /// Stores the list of all the windows. /// Only available on callback thread. local_data_key!(pub WINDOWS_LIST: Mutex)>>) diff --git a/src/x11/mod.rs b/src/x11/mod.rs index cc70a019..e00dc501 100644 --- a/src/x11/mod.rs +++ b/src/x11/mod.rs @@ -1,4 +1,4 @@ -use {Event, Hints, MonitorID}; +use {Event, Hints}; use libc; use std::{mem, ptr}; use std::sync::atomics::AtomicBool; @@ -14,6 +14,8 @@ pub struct Window { wm_delete_window: ffi::Atom, } +pub struct MonitorID(uint); + impl Window { pub fn new(dimensions: Option<(uint, uint)>, title: &str, hints: &Hints, _: Option) -> Result