<!--
{
  "availability" : [
    "macCatalyst: 13.1.0 -",
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreGraphics",
  "identifier" : "/documentation/CoreGraphics/CGGetActiveDisplayList(_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Graphics"
    ],
    "preciseIdentifier" : "c:@F@CGGetActiveDisplayList"
  },
  "title" : "CGGetActiveDisplayList(_:_:_:)"
}
-->

# CGGetActiveDisplayList(_:_:_:)

Provides a list of displays that are active for drawing.

```
func CGGetActiveDisplayList(_ maxDisplays: UInt32, _ activeDisplays: UnsafeMutablePointer<CGDirectDisplayID>?, _ displayCount: UnsafeMutablePointer<UInt32>?) -> CGError
```

## Parameters

`maxDisplays`

The size of the `activeDisplays` array. This value determines the maximum number of displays the list includes.

`activeDisplays`

A pointer to storage you provide for an array of display IDs. On return, the array contains a list of active displays. If you pass `NULL`, on return the display count contains the total number of active displays.

`displayCount`

A pointer to a display count variable you provide. On return, the display count contains the actual number of displays the function added to the `activeDisplays` array. This value is at most `maxDisplays`.

## Return Value

A result code. To interpret the result code, see [`CGError`](/documentation/CoreGraphics/CGError).

## Discussion

The first entry in the list of active displays is the main display. In case of mirroring, the first entry is the largest drawable display or, if all are the same size, the display with the greatest pixel depth.

Note that when using hardware mirroring between displays, only the primary display is active and appears in the list. When using software mirroring, all the mirrored displays are active and appear in the list. For more information about mirroring, see [`CGConfigureDisplayMirrorOfDisplay(_:_:_:)`](/documentation/CoreGraphics/CGConfigureDisplayMirrorOfDisplay(_:_:_:)).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)