Compare commits

...

2 Commits

Author SHA1 Message Date
Max Thrun
73a9eed144
Merge 8fcf59f883 into 228e58262e 2024-04-12 21:04:39 +08:00
Max Thrun
8fcf59f883 Cocoa: Ignore monitors which are mirroring another
Currently monitors which are mirroring another one are returned by
`glfwGetMonitors` but their `ns.screen` is `NULL`. Some functions like
`glfwGetMonitorContentScale` and `glfwGetMonitorWorkarea` assert that
`ns.screen` is not `NULL`. Since mirrored monitors are logically the
same we should only consider the primary monitor and ignore the
non-primary ones.
2023-11-06 22:13:59 -08:00

View File

@ -319,6 +319,9 @@ void _glfwPollMonitorsCocoa(void)
if (CGDisplayIsAsleep(displays[i]))
continue;
if (CGDisplayMirrorsDisplay(displays[i]) != kCGNullDirectDisplay)
continue;
const uint32_t unitNumber = CGDisplayUnitNumber(displays[i]);
NSScreen* screen = nil;