CGMainDisplayID()
Returns the display ID of the main display.
Declaration
func CGMainDisplayID() -> CGDirectDisplayIDReturn Value
The display ID assigned to the main display.
Discussion
The main display is the display with its screen location at (0,0) in the global display coordinate space. In a system without display mirroring, the display with the menu bar is typically the main display.
If mirroring is enabled and the menu bar appears on more than one display, this function provides a reliable way to find the main display.
In case of hardware mirroring, the drawable display becomes the main display. In case of software mirroring, the display with the highest resolution and deepest pixel depth typically becomes the main display.
See Also
Functions
CGAcquireDisplayFadeReservation(_:_:)CGAssociateMouseAndMouseCursorPosition(_:)CGBeginDisplayConfiguration(_:)CGCancelDisplayConfiguration(_:)CGCaptureAllDisplays()CGCaptureAllDisplaysWithOptions(_:)CGCompleteDisplayConfiguration(_:_:)CGConfigureDisplayFadeEffect(_:_:_:_:_:_:)CGConfigureDisplayMirrorOfDisplay(_:_:_:)CGConfigureDisplayMode(_:_:_:)CGConfigureDisplayOrigin(_:_:_:_:)CGConfigureDisplayStereoOperation(_:_:_:_:)CGConfigureDisplayWithDisplayMode(_:_:_:_:)CGCursorIsDrawnInFramebuffer()CGCursorIsVisible()