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:
Mads Marquart 2025-04-29 12:26:03 +02:00 committed by GitHub
parent a5e6d0aaaf
commit 1800fa1670
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 106 additions and 54 deletions

View file

@ -24,6 +24,8 @@ pub const kIO30BitDirectPixels: &str = "--RRRRRRRRRRGGGGGGGGGGBBBBBBBBBB";
#[link(name = "ApplicationServices", kind = "framework")]
extern "C" {
pub fn CGDisplayCreateUUIDFromDisplayID(display: CGDirectDisplayID) -> *mut CFUUID;
pub fn CGDisplayGetDisplayIDFromUUID(uuid: &CFUUID) -> CGDirectDisplayID;
}
#[link(name = "CoreGraphics", kind = "framework")]