Merge pull request #112 from DavidPartouche/cocoa_fix

Fixed an issue with the updated rust-cocoa crate
This commit is contained in:
tomaka 2014-11-12 08:57:48 +01:00
commit 6995878cea
2 changed files with 4 additions and 3 deletions

View file

@ -1,6 +1,4 @@
use events;
use cocoa::base::NSUInteger;
use cocoa::appkit;
pub fn vkeycode_to_element(code: u16) -> Option<events::VirtualKeyCode> {
Some(match code {

View file

@ -113,7 +113,10 @@ impl Window {
fn create_window(dimensions: (uint, uint), title: &str, monitor: Option<MonitorID>) -> Option<id> {
unsafe {
let scr_frame = match monitor {
Some(_) => NSScreen::mainScreen(nil).frame(),
Some(_) => {
let screen = NSScreen::mainScreen(nil);
NSScreen::frame(screen)
}
None => {
let (width, height) = dimensions;
NSRect::new(NSPoint::new(0., 0.), NSSize::new(width as f64, height as f64))