---
title: CGScreenRefreshCallback
framework: coregraphics
role: symbol
role_heading: Type Alias
path: coregraphics/cgscreenrefreshcallback
---

# CGScreenRefreshCallback

A client-supplied callback function that’s invoked when an area of the display is modified or refreshed.

## Declaration

```swift
typealias CGScreenRefreshCallback = (UInt32, UnsafePointer<CGRect>, UnsafeMutableRawPointer?) -> Void
```

## Parameters

- `count`: The number of rectangles in the rectArray parameter.
- `rectArray`: A list of the rectangles in the refreshed areas, specified in the global display coordinate space. The origin is the upper-left corner of the main display. You should not modify or deallocate memory pointed to by rectArray.
- `userParameter`: The user data you specify when you register this callback.

## Discussion

Discussion To register a screen-refresh callback function, you call the function CGRegisterScreenRefreshCallback(_:_:). Quartz invokes your callback function when operations such as drawing, window movement, scrolling, or display reconfiguration occur on local displays. When you finish using a callback registration, you should call the function CGUnregisterScreenRefreshCallback(_:_:) to remove it. Note that a single rectangle may occupy multiple displays, either by overlapping the displays or by residing on coincident displays when mirroring is active. You can use the function CGGetDisplaysWithRect(_:_:_:_:) to determine the displays a rectangle occupies.

## See Also

### Data Types

- [CGButtonCount](coregraphics/cgbuttoncount.md)
- [CGCharCode](coregraphics/cgcharcode.md)
- [CGDirectDisplayID](coregraphics/cgdirectdisplayid.md)
- [CGDisplayBlendFraction](coregraphics/cgdisplayblendfraction.md)
- [CGDisplayConfigRef](coregraphics/cgdisplayconfigref.md)
- [CGDisplayCount](coregraphics/cgdisplaycount.md)
- [CGDisplayErr](coregraphics/cgdisplayerr.md)
- [CGDisplayFadeInterval](coregraphics/cgdisplayfadeinterval.md)
- [CGDisplayFadeReservationToken](coregraphics/cgdisplayfadereservationtoken.md)
- [CGDisplayMode](coregraphics/cgdisplaymode.md)
- [CGDisplayReconfigurationCallBack](coregraphics/cgdisplayreconfigurationcallback.md)
- [CGDisplayReservationInterval](coregraphics/cgdisplayreservationinterval.md)
- [CGDisplayStream](coregraphics/cgdisplaystream.md)
- [CGDisplayStreamFrameAvailableHandler](coregraphics/cgdisplaystreamframeavailablehandler.md)
- [CGDisplayStreamUpdate](coregraphics/cgdisplaystreamupdate.md)
