mirror of
https://github.com/rust-windowing/winit.git
synced 2026-08-30 21:30:03 -04:00
Merge pull request #316 from binsoftware/cocoa-fixes
Cocoa fixes: memory leaks, monitor handling, is_current()
This commit is contained in:
@@ -2,6 +2,7 @@ use std::ptr;
|
||||
use std::collections::VecDeque;
|
||||
use super::super::ffi;
|
||||
use super::ensure_thread_init;
|
||||
use native_monitor::NativeMonitorId;
|
||||
|
||||
pub struct MonitorID(pub u32);
|
||||
|
||||
@@ -43,6 +44,11 @@ impl MonitorID {
|
||||
Some(format!("Monitor #{}", screen_num))
|
||||
}
|
||||
|
||||
pub fn get_native_identifier(&self) -> NativeMonitorId {
|
||||
let MonitorID(screen_num) = *self;
|
||||
NativeMonitorId::Numeric(screen_num)
|
||||
}
|
||||
|
||||
pub fn get_dimensions(&self) -> (u32, u32) {
|
||||
let dimensions = unsafe {
|
||||
let display = ffi::XOpenDisplay(ptr::null());
|
||||
|
||||
Reference in New Issue
Block a user