CGWaitForScreenUpdateRects(_:_:_:_:_:)
Waits for screen update operations.
Declaration
func CGWaitForScreenUpdateRects(_ requestedOperations: CGScreenUpdateOperation, _ currentOperation: UnsafeMutablePointer<CGScreenUpdateOperation>?, _ rects: UnsafeMutablePointer<UnsafeMutablePointer<CGRect>?>?, _ rectCount: UnsafeMutablePointer<Int>?, _ delta: UnsafeMutablePointer<CGScreenUpdateMoveDelta>?) -> CGErrorParameters
- requestedOperations:
The desired types of screen update operations. There are several possible choices:
Specify
kCGScreenUpdateOperationRefreshif 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
kCGScreenUpdateOperationReducedDirtyRectangleCountto 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
CGScreenUpdateOperationvariable. 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_tvariable. On return, the variable contains the number of entries in the returned array of rectangles. - delta:
A pointer to a
CGScreenUpdateMoveDeltavariable. On return, if the value of thecurrentOperationparameter iskCGScreenUpdateOperationMove, 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
CGAcquireDisplayFadeReservation(_:_:)CGAssociateMouseAndMouseCursorPosition(_:)CGBeginDisplayConfiguration(_:)CGCancelDisplayConfiguration(_:)CGCaptureAllDisplays()CGCaptureAllDisplaysWithOptions(_:)CGCompleteDisplayConfiguration(_:_:)CGConfigureDisplayFadeEffect(_:_:_:_:_:_:)CGConfigureDisplayMirrorOfDisplay(_:_:_:)CGConfigureDisplayMode(_:_:_:)CGConfigureDisplayOrigin(_:_:_:_:)CGConfigureDisplayStereoOperation(_:_:_:_:)CGConfigureDisplayWithDisplayMode(_:_:_:_:)CGCursorIsDrawnInFramebuffer()CGCursorIsVisible()