aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/win32/init.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/init.rs
parent78eb4a5990dadb3402dd3e80d04e2cfd7f9dd6fd (diff)
downloadglutin-d6a53cf5d3ba9c41f4bd6255012ac2adfc6487b4.tar.gz
glutin-d6a53cf5d3ba9c41f4bd6255012ac2adfc6487b4.zip
Corrections to sharing data
Diffstat (limited to 'src/api/win32/init.rs')
-rw-r--r--src/api/win32/init.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/api/win32/init.rs b/src/api/win32/init.rs
index 6b52660..26ccba6 100644
--- a/src/api/win32/init.rs
+++ b/src/api/win32/init.rs
@@ -5,7 +5,7 @@ use std::mem;
use std::thread;
use super::callback;
-use super::callback::WindowState;
+use super::WindowState;
use super::Window;
use super::MonitorId;
use super::WindowWrapper;
@@ -215,8 +215,11 @@ unsafe fn init(title: Vec<u16>, window: &WindowAttributes, pf_reqs: &PixelFormat
user32::SetForegroundWindow(real_window.0);
}
- // Creating a mutex to track the current cursor state
- let cursor_state = CursorState::Normal;
+ // Creating a mutex to track the current window state
+ let window_state = Arc::new(Mutex::new(WindowState {
+ cursor_state: CursorState::Normal,
+ attributes: window.clone()
+ }));
// filling the CONTEXT_STASH task-local storage so that we can start receiving events
let events_receiver = {
@@ -226,10 +229,7 @@ unsafe fn init(title: Vec<u16>, window: &WindowAttributes, pf_reqs: &PixelFormat
let data = callback::ThreadLocalData {
win: real_window.0,
sender: tx.take().unwrap(),
- window_state: Arc::new(Mutex::new(WindowState {
- cursor_state: cursor_state.clone(),
- attributes: window.clone()
- }))
+ window_state: window_state.clone()
};
(*context_stash.borrow_mut()) = Some(data);
});
@@ -241,7 +241,7 @@ unsafe fn init(title: Vec<u16>, window: &WindowAttributes, pf_reqs: &PixelFormat
window: real_window,
context: context,
events_receiver: events_receiver,
- cursor_state: cursor_state,
+ window_state: window_state,
})
}