aboutsummaryrefslogtreecommitdiffstats
path: root/src/win32/init.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/win32/init.rs')
-rw-r--r--src/win32/init.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/win32/init.rs b/src/win32/init.rs
index 08d54c0..c5e18cc 100644
--- a/src/win32/init.rs
+++ b/src/win32/init.rs
@@ -15,11 +15,13 @@ use Api;
use BuilderAttribs;
use CreationError;
use CreationError::OsError;
+use CursorState;
use GlRequest;
use PixelFormat;
use std::ffi::CString;
use std::sync::mpsc::channel;
+use std::sync::Mutex;
use libc;
use super::gl;
@@ -250,6 +252,7 @@ unsafe fn init(title: Vec<u16>, builder: BuilderAttribs<'static>,
gl_library: gl_library,
events_receiver: events_receiver,
is_closed: AtomicBool::new(false),
+ cursor_state: Mutex::new(CursorState::Normal),
})
}
@@ -265,7 +268,7 @@ unsafe fn register_window_class() -> Vec<u16> {
cbWndExtra: 0,
hInstance: kernel32::GetModuleHandleW(ptr::null()),
hIcon: ptr::null_mut(),
- hCursor: ptr::null_mut(),
+ hCursor: ptr::null_mut(), // must be null in order for cursor state to work properly
hbrBackground: ptr::null_mut(),
lpszMenuName: ptr::null(),
lpszClassName: class_name.as_ptr(),