Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

CGDisplayReconfigurationEventMBS class

Type Topic Plugin Version macOS Windows Linux Console & Web iOS
class CoreGraphics MBS MacCG Plugin 11.1 Yes No No Yes, macOS only No
Function: The class to listen for display configuration changes.
In constructor the plugin registers for the event and in destructor unregisters. So keep the object reference alive to receive events.

events are invoked when the app is listening for events, on the event processing thread, or from within the display reconfiguration function when in the program that is driving the reconfiguration.

events should avoid changing display configurations, and should not raise exceptions or perform a non-local return such as calling longjmp.

Before display reconfiguration, a event fires to inform applications of a configuration change. The event runs once for each on-line display. The flag is set to kCGDisplayBeginConfigurationFlag. This event does not carry other per-display information, as details of how a reconfiguration affects a particular device rely on device-specific behaviors which may not be exposed by a device driver.

After display reconfiguration, at the time the event function is invoked, all display state reported by CoreGraphics, QuickDraw, and the Carbon Display Manager API will be up to date. This event runs after the Carbon Display Manager notification events. The event runs once for each added, removed, and currently on-line display. Note that in the case of removed displays, calls into the CoreGraphics API with the removed display ID will fail.

Feedback, Comments & Corrections

Possible Flag Values

Constant Value Description
kCGDisplayAddFlag 16 Display Added
kCGDisplayBeginConfigurationFlag 1 Begin Configuration for display.
kCGDisplayDesktopShapeChangedFlag 4096 Desktop Shape Changed.
kCGDisplayDisabledFlag 512 Display disabled.
kCGDisplayEnabledFlag 256 Display enabled.
kCGDisplayMirrorFlag 1024 Mirror enabled
kCGDisplayMovedFlag 2 Display Moved
kCGDisplayRemoveFlag 32 Display Removed
kCGDisplaySetMainFlag 4 Set Main
kCGDisplaySetModeFlag 8 Set Mode
kCGDisplayUnMirrorFlag 2048 Mirror disabled

This class has no sub classes.

Some examples which use this class:

The items on this page are in the following plugins: MBS MacCG Plugin.

CGDisplayModeMBS   -   CGDisplayStreamEventMBS

MBS Xojo Plugins