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
|
|
@ -1,5 +1,6 @@
|
|||
use core_graphics::display;
|
||||
use std::collections::VecDeque;
|
||||
use native_monitor::NativeMonitorId;
|
||||
|
||||
pub struct MonitorID(u32);
|
||||
|
||||
|
|
@ -35,6 +36,11 @@ impl MonitorID {
|
|||
Some(format!("Monitor #{}", screen_num))
|
||||
}
|
||||
|
||||
pub fn get_native_identifier(&self) -> NativeMonitorId {
|
||||
let MonitorID(display_id) = *self;
|
||||
NativeMonitorId::Numeric(display_id)
|
||||
}
|
||||
|
||||
pub fn get_dimensions(&self) -> (u32, u32) {
|
||||
let MonitorID(display_id) = *self;
|
||||
let dimension = unsafe {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue