mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 10:05:10 +00:00
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.
This commit is contained in:
parent
3eaf1255b2
commit
8fcf59f883
@ -320,6 +320,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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user