aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/win32/callback.rs
diff options
context:
space:
mode:
authorAceeri <conmcclusk@gmail.com>2015-11-09 02:49:50 -0800
committerAceeri <conmcclusk@gmail.com>2015-11-09 02:49:50 -0800
commitd6a53cf5d3ba9c41f4bd6255012ac2adfc6487b4 (patch)
tree1fa8ce90ad3e9754e3dd56e9493e878dfe675826 /src/api/win32/callback.rs
parent78eb4a5990dadb3402dd3e80d04e2cfd7f9dd6fd (diff)
downloadglutin-d6a53cf5d3ba9c41f4bd6255012ac2adfc6487b4.tar.gz
glutin-d6a53cf5d3ba9c41f4bd6255012ac2adfc6487b4.zip
Corrections to sharing data
Diffstat (limited to 'src/api/win32/callback.rs')
-rw-r--r--src/api/win32/callback.rs10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/api/win32/callback.rs b/src/api/win32/callback.rs
index a36320b..bc2b6a6 100644
--- a/src/api/win32/callback.rs
+++ b/src/api/win32/callback.rs
@@ -10,6 +10,7 @@ use WindowAttributes;
use CursorState;
use Event;
use super::event;
+use super::WindowState;
use user32;
use shell32;
@@ -20,13 +21,6 @@ use winapi;
/// a thread-local variable.
thread_local!(pub static CONTEXT_STASH: RefCell<Option<ThreadLocalData>> = RefCell::new(None));
-/// Contains information about states and the window for the callback.
-#[derive(Clone)]
-pub struct WindowState {
- pub cursor_state: CursorState,
- pub attributes: WindowAttributes
-}
-
pub struct ThreadLocalData {
pub win: winapi::HWND,
pub sender: Sender<Event>,
@@ -257,7 +251,7 @@ pub unsafe extern "system" fn callback(window: winapi::HWND, msg: winapi::UINT,
let cstash = cstash.as_ref();
// there's a very bizarre borrow checker bug
// possibly related to rust-lang/rust/#23338
- let _window_state = if let Some(cstash) = cstash {
+ let _cursor_state = if let Some(cstash) = cstash {
if let Ok(window_state) = cstash.window_state.lock() {
match window_state.cursor_state {
CursorState::Normal => {