diff --git a/glfw/cocoa_monitor.m b/glfw/cocoa_monitor.m index 1117ededa..6911aa090 100644 --- a/glfw/cocoa_monitor.m +++ b/glfw/cocoa_monitor.m @@ -61,7 +61,7 @@ getDisplayName(CGDirectDisplayID displayID, NSScreen* screen) io_service_t service; CFDictionaryRef info; - if (IOServiceGetMatchingServices(kIOMainPortDefault, + if (IOServiceGetMatchingServices(NULL, IOServiceMatching("IODisplayConnect"), &it) != 0) { @@ -259,7 +259,7 @@ static double getFallbackRefreshRate(CGDirectDisplayID displayID) io_iterator_t it; io_service_t service; - if (IOServiceGetMatchingServices(kIOMainPortDefault, + if (IOServiceGetMatchingServices(NULL, IOServiceMatching("IOFramebuffer"), &it) != 0) { diff --git a/glfw/cocoa_platform.h b/glfw/cocoa_platform.h index 8f6d7a2cf..faf3ad20d 100644 --- a/glfw/cocoa_platform.h +++ b/glfw/cocoa_platform.h @@ -39,9 +39,6 @@ typedef void* CVDisplayLinkRef; // NOTE: Many Cocoa enum values have been renamed and we need to build across // SDK versions where one is unavailable or the other deprecated // We use the newer names in code and these macros to handle compatibility -#if (MAC_OS_X_VERSION_MAX_ALLOWED < 120000) // Before macOS 12 Monterey - #define kIOMainPortDefault kIOMasterPortDefault -#endif #if MAC_OS_X_VERSION_MAX_ALLOWED < 101200 #define NSBitmapFormatAlphaNonpremultiplied NSAlphaNonpremultipliedBitmapFormat #define NSEventMaskAny NSAnyEventMask