Contents

CGConfigureDisplayOrigin(_:_:_:_:)

Configures the origin of a display relative to the global display coordinate space.

Declaration

func CGConfigureDisplayOrigin(_ config: CGDisplayConfigRef?, _ display: CGDirectDisplayID, _ x: Int32, _ y: Int32) -> CGError

Parameters

  • config:

    A display configuration that you acquire by calling Cgbegindisplayconfiguration(_:).

  • display:

    The identifier of the display to configure.

  • x:

    The desired x-coordinate for the upper-left corner of the display.

  • y:

    The desired y-coordinate for the upper-left corner of the display.

Return Value

A result code. If the request to configure the origin of the display is successful, the result is kCGErrorSuccess. For other possible values, see CGError.

Discussion

In Quartz, the upper-left corner of a display is the origin. You specify the origin of a display in the global display coordinate space. The origin of the main or primary display is (0,0).

The placement of the new origin is as close as possible to the requested location, without overlapping or leaving a gap between displays.

If you use this function to change the origin of a mirrored display, the mirrored set might not include the display.

See Also

Functions