Contents

CGDisplayRegisterReconfigurationCallback(_:_:)

Registers a callback function to be invoked whenever a local display is reconfigured.

Declaration

func CGDisplayRegisterReconfigurationCallback(_ callback: CGDisplayReconfigurationCallBack?, _ userInfo: UnsafeMutableRawPointer?) -> CGError

Parameters

  • callback:

    A pointer to the callback function to be registered.

  • userInfo:

    A pointer to user-defined data, or NULL. The userInfo argument is passed back to the callback function each time it’s invoked.

Discussion

Whenever local displays are reconfigured, the callback function you register is invoked twice for each display that’s added, removed, or currently online—once before the reconfiguration, and once after the reconfiguration. For more information, see the callback type CGDisplayReconfigurationCallBack.

A callback function may be registered multiple times with different user-defined data pointers, resulting in multiple registration entries. For each registration, when notification is no longer needed you should remove the registration by calling the function CGDisplayRemoveReconfigurationCallback(_:_:).

See Also

Functions