mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-25 06:41:31 +11:00
Fixed an issue with the updated rust-cocoa crate
This commit is contained in:
parent
293dcdc9a4
commit
77d00a8e5a
|
@ -1,6 +1,4 @@
|
||||||
use events;
|
use events;
|
||||||
use cocoa::base::NSUInteger;
|
|
||||||
use cocoa::appkit;
|
|
||||||
|
|
||||||
pub fn vkeycode_to_element(code: u16) -> Option<events::VirtualKeyCode> {
|
pub fn vkeycode_to_element(code: u16) -> Option<events::VirtualKeyCode> {
|
||||||
Some(match code {
|
Some(match code {
|
||||||
|
|
|
@ -113,7 +113,10 @@ impl Window {
|
||||||
fn create_window(dimensions: (uint, uint), title: &str, monitor: Option<MonitorID>) -> Option<id> {
|
fn create_window(dimensions: (uint, uint), title: &str, monitor: Option<MonitorID>) -> Option<id> {
|
||||||
unsafe {
|
unsafe {
|
||||||
let scr_frame = match monitor {
|
let scr_frame = match monitor {
|
||||||
Some(_) => NSScreen::mainScreen(nil).frame(),
|
Some(_) => {
|
||||||
|
let screen = NSScreen::mainScreen(nil);
|
||||||
|
NSScreen::frame(screen)
|
||||||
|
}
|
||||||
None => {
|
None => {
|
||||||
let (width, height) = dimensions;
|
let (width, height) = dimensions;
|
||||||
NSRect::new(NSPoint::new(0., 0.), NSSize::new(width as f64, height as f64))
|
NSRect::new(NSPoint::new(0., 0.), NSSize::new(width as f64, height as f64))
|
||||||
|
|
Loading…
Reference in a new issue