Using [NSScreen screens] I'm able to get all of the screens attached to the computer and their sizes, however I'm trying to find out their positions relative to each other (like in Arrangement in the Display preferences). Is there a way to do this? I've looked online and through the class references on Apple's developer site and found nothing. Thank you.
For each of the screens returned by [NSScreen screens]
you can call:
[screen frame]
to get an NSRect
containing the size
and offset
of each screen. The "main" screen (i.e. the one with the menu bar) will have offset (0, 0)
.
This should be a lot simpler than handling the -deviceDescription
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With