Implement MonitorId::get_hidpi_factor for macOS (#410)

* Implement MonitorId::get_hidpi_factor for macOS

* Added changelog entry
This commit is contained in:
Nicholas Lordello 2018-03-06 09:35:04 +01:00 committed by Pierre Krieger
parent 4c62d71950
commit f3d43016ad
4 changed files with 47 additions and 27 deletions

View file

@ -86,6 +86,8 @@ impl WindowBuilderExt for WindowBuilder {
pub trait MonitorIdExt {
/// Returns the identifier of the monitor for Cocoa.
fn native_id(&self) -> u32;
/// Returns a pointer to the NSScreen representing this monitor.
fn get_nsscreen(&self) -> Option<*mut c_void>;
}
impl MonitorIdExt for MonitorId {
@ -93,4 +95,8 @@ impl MonitorIdExt for MonitorId {
fn native_id(&self) -> u32 {
self.inner.get_native_identifier()
}
fn get_nsscreen(&self) -> Option<*mut c_void> {
self.inner.get_nsscreen().map(|s| s as *mut c_void)
}
}