Contents

CGWaitForScreenUpdateRects(_:_:_:_:_:)

Waits for screen update operations.

Declaration

func CGWaitForScreenUpdateRects(_ requestedOperations: CGScreenUpdateOperation, _ currentOperation: UnsafeMutablePointer<CGScreenUpdateOperation>?, _ rects: UnsafeMutablePointer<UnsafeMutablePointer<CGRect>?>?, _ rectCount: UnsafeMutablePointer<Int>?, _ delta: UnsafeMutablePointer<CGScreenUpdateMoveDelta>?) -> CGError

Parameters

  • requestedOperations:

    The desired types of screen update operations. There are several possible choices:

    • Specify kCGScreenUpdateOperationRefresh if you want all move operations to be returned as refresh operations.

    • Specify (kCGScreenUpdateOperationRefresh | kCGScreenUpdateOperationMove) if you want to distinguish between move and refresh operations.

    • Add kCGScreenUpdateOperationReducedDirtyRectangleCount to the screen operations if you want to minimize the number of rectangles returned to represent changed areas of the display.

  • currentOperation:

    A pointer to a CGScreenUpdateOperation variable. On return, the variable indicates the type of update operation (refresh or move).

  • rects:

    A pointer to a CGRect* variable. On return, the variable contains an array of rectangles that bound the updated areas, specified in the global display coordinate space. When you no longer need the array, you should deallocate it by calling Cgreleasescreenrefreshrects(_:).

  • rectCount:

    A pointer to a size_t variable. On return, the variable contains the number of entries in the returned array of rectangles.

  • delta:

    A pointer to a CGScreenUpdateMoveDelta variable. On return, if the value of the currentOperation parameter is kCGScreenUpdateOperationMove, the variable contains the distance moved.

Return Value

A result code. See Core Graphics Data Types and Constants.

Discussion

In some applications it may be preferable to wait for screen-update data synchronously, using this function. You should call this function in a thread other than the main event-processing thread.

As an alternative, Quartz also supports asynchronous notification—see CGRegisterScreenRefreshCallback(_:_:) and CGScreenRegisterMoveCallback(_:_:). If refresh or move callback functions are registered, this function should not be used.

Special Considerations

This function is implemented in macOS 10.4.3 and later.

See Also

Functions