mirror of
https://github.com/rust-windowing/winit.git
synced 2026-08-31 05:40:04 -04:00
Implement MonitorId::get_hidpi_factor for macOS (#410)
* Implement MonitorId::get_hidpi_factor for macOS * Added changelog entry
This commit is contained in:
committed by
Pierre Krieger
parent
4c62d71950
commit
f3d43016ad
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user