Merge pull request #316 from binsoftware/cocoa-fixes
Cocoa fixes: memory leaks, monitor handling, is_current()
This commit is contained in:
commit
8a463f6643
7 changed files with 204 additions and 72 deletions
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue