Minimum/maximum dimensions for windows in win32 api

This commit is contained in:
Aceeri 2015-11-09 01:42:54 -08:00
parent 5ca4e89dd4
commit 78eb4a5990
5 changed files with 98 additions and 13 deletions

View file

@ -5,6 +5,7 @@ use std::mem;
use std::thread;
use super::callback;
use super::callback::WindowState;
use super::Window;
use super::MonitorId;
use super::WindowWrapper;
@ -215,7 +216,7 @@ unsafe fn init(title: Vec<u16>, window: &WindowAttributes, pf_reqs: &PixelFormat
}
// Creating a mutex to track the current cursor state
let cursor_state = Arc::new(Mutex::new(CursorState::Normal));
let cursor_state = CursorState::Normal;
// filling the CONTEXT_STASH task-local storage so that we can start receiving events
let events_receiver = {
@ -225,7 +226,10 @@ unsafe fn init(title: Vec<u16>, window: &WindowAttributes, pf_reqs: &PixelFormat
let data = callback::ThreadLocalData {
win: real_window.0,
sender: tx.take().unwrap(),
cursor_state: cursor_state.clone()
window_state: Arc::new(Mutex::new(WindowState {
cursor_state: cursor_state.clone(),
attributes: window.clone()
}))
};
(*context_stash.borrow_mut()) = Some(data);
});