macOS: Store UUID in MonitorHandle instead of CGDirectDisplayID (#4167)
The monitor UUID is what actually represents the monitor, CGDirectDisplayID is closer in correspondence to a specific framebuffer.
This commit is contained in:
parent
a5e6d0aaaf
commit
1800fa1670
4 changed files with 106 additions and 54 deletions
|
|
@ -1756,7 +1756,8 @@ impl WindowDelegate {
|
|||
// Allow directly accessing the current monitor internally without unwrapping.
|
||||
pub(crate) fn current_monitor_inner(&self) -> Option<MonitorHandle> {
|
||||
let display_id = get_display_id(&*self.window().screen()?);
|
||||
Some(MonitorHandle::new(display_id))
|
||||
// Display ID just fetched from live NSScreen, should be fine to unwrap.
|
||||
Some(MonitorHandle::new(display_id).expect("invalid display ID"))
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue