diff --git a/src/lib.rs b/src/lib.rs index 1e10768f..4de2f449 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -142,7 +142,7 @@ pub enum GlRequest { }, } -#[derive(Debug, Copy)] +#[derive(Debug, Copy, Clone)] pub enum MouseCursor { /// The platform-dependent default cursor. Default, @@ -199,7 +199,7 @@ pub enum MouseCursor { } /// Describes how glutin handles the cursor. -#[derive(Debug, Copy)] +#[derive(Debug, Copy, Clone)] pub enum CursorState { /// Normal cursor behavior. Normal, diff --git a/src/win32/init.rs b/src/win32/init.rs index d83c90fb..41e87bb1 100644 --- a/src/win32/init.rs +++ b/src/win32/init.rs @@ -40,8 +40,8 @@ pub fn new_window(builder: BuilderAttribs<'static>, builder_sharelists: Option>(); + let title = OsStr::new(&builder.title).encode_wide().chain(Some(0).into_iter()) + .collect::>(); let (tx, rx) = channel(); @@ -267,8 +267,8 @@ unsafe fn init(title: Vec, builder: BuilderAttribs<'static>, } unsafe fn register_window_class() -> Vec { - let class_name = OsStr::from_str("Window Class").encode_wide().chain(Some(0).into_iter()) - .collect::>(); + let class_name = OsStr::new("Window Class").encode_wide().chain(Some(0).into_iter()) + .collect::>(); let class = winapi::WNDCLASSEXW { cbSize: mem::size_of::() as winapi::UINT, @@ -530,8 +530,8 @@ unsafe fn set_pixel_format(hdc: &WindowWrapper, id: libc::c_int) -> Result<(), C } unsafe fn load_opengl32_dll() -> Result { - let name = OsStr::from_str("opengl32.dll").encode_wide().chain(Some(0).into_iter()) - .collect::>(); + let name = OsStr::new("opengl32.dll").encode_wide().chain(Some(0).into_iter()) + .collect::>(); let lib = kernel32::LoadLibraryW(name.as_ptr()); diff --git a/src/win32/mod.rs b/src/win32/mod.rs index be72d539..1f5f3c06 100644 --- a/src/win32/mod.rs +++ b/src/win32/mod.rs @@ -111,8 +111,8 @@ impl Window { /// /// Calls SetWindowText on the HWND. pub fn set_title(&self, text: &str) { - let text = OsStr::from_str(text).encode_wide().chain(Some(0).into_iter()) - .collect::>(); + let text = OsStr::new(text).encode_wide().chain(Some(0).into_iter()) + .collect::>(); unsafe { user32::SetWindowTextW(self.window.0, text.as_ptr() as winapi::LPCWSTR); diff --git a/src/x11/window/mod.rs b/src/x11/window/mod.rs index fa8f91ca..3820bd4b 100644 --- a/src/x11/window/mod.rs +++ b/src/x11/window/mod.rs @@ -7,7 +7,7 @@ use std::cell::Cell; use std::sync::atomic::AtomicBool; use std::collections::VecDeque; use super::ffi; -use std::sync::{Arc, Mutex, Once, ONCE_INIT, Weak}; +use std::sync::{Arc, Mutex, Once, ONCE_INIT}; use Api; use CursorState;