Offers notification when displays appear or disappear.
GdkDisplayManager is a singleton object.
You can use [funcGdk.DisplayManager.get] to obtain the GdkDisplayManager singleton, but that should be rarely necessary. Typically, initializing GTK opens a display that you can work with without ever accessing the GdkDisplayManager.
The GDK library can be built with support for multiple backends. The GdkDisplayManager object determines which backend is used at runtime.
In the rare case that you need to influence which of the backends is being used, you can use [funcGdk.set_allowed_backends]. Note that you need to call this function before initializing GTK.
## Backend-specific code
When writing backend-specific code that is supposed to work with multiple GDK backends, you have to consider both compile time and runtime. At compile time, use the GDK_WINDOWING_X11, GDK_WINDOWING_WIN32 macros, etc. to find out which backends are present in the GDK library you are building your application against. At runtime, use type-check macros like GDK_IS_X11_DISPLAY to find out which backend is in use:
X11-specific calls here } else endif ifdef GDK_WINDOWING_MACOS if
(GDK_IS_MACOS_DISPLAY (display)) { // make Quartz-specific calls here }
else endif g_error ("Unsupported GDK backend"); ```
type Cb_Gdk_Display_Manager_Gdk_Display_Void is not null access procedure
(Self : access Gdk_Display_Manager_Record'Class;
Display : not null access Gdk.Display.Gdk_Display_Record'Class);
type Cb_GObject_Gdk_Display_Void is not null access procedure
(Self : access Glib.Object.GObject_Record'Class;
Display : not null access Gdk.Display.Gdk_Display_Record'Class);
Default_Display_Property : constant Glib.Properties.Property_Boxed;
Type: Display The default display.
type Gdk_Display_Manager is access all Gdk_Display_Manager_Record'Class;
type Gdk_Display_Manager_Record is new GObject_Record with null record;
function Get return Gdk_Display_Manager
Gets the singleton GdkDisplayManager object. When called for the first time, this function consults the GDK_BACKEND environment variable to find out which of the supported GDK backends to use (in case GDK has been compiled with multiple backends). Applications can use [funcSet_Allowed_Backends] to limit what backends will be used.
The global GdkDisplayManager singleton. Has transfer-ownership='none'.
function Get_Default_Display
(Self : not null access Gdk_Display_Manager_Record)
return Gdk.Gdk_Display
Gets the default GdkDisplay.
a GdkDisplay. Has transfer-ownership='none'.
function Get_Type return Glib.GType
function List_Displays
(Self : not null access Gdk_Display_Manager_Record)
return Gdk.Display.Display_List.Glist
List all currently open displays.
a newly allocated GSList of GdkDisplay objects
procedure On_Display_Opened
(Self : not null access Gdk_Display_Manager_Record;
Call : Cb_Gdk_Display_Manager_Gdk_Display_Void;
After : Boolean := False)
Emitted when a display is opened.
procedure On_Display_Opened
(Self : not null access Gdk_Display_Manager_Record;
Call : Cb_GObject_Gdk_Display_Void;
Slot : not null access Glib.Object.GObject_Record'Class;
After : Boolean := False)
Emitted when a display is opened.
function Open_Display
(Self : not null access Gdk_Display_Manager_Record;
Name : UTF8_String := "") return Gdk.Gdk_Display
Opens a display.
the name of the display to open
a GdkDisplay, or null if the display could not be opened. Has transfer-ownership='none'.
procedure Set_Default_Display
(Self : not null access Gdk_Display_Manager_Record;
Display : not null access Gdk.Display.Gdk_Display_Record'Class)
Sets Display as the default display.
a GdkDisplay
Signal_Display_Opened : constant Glib.Signal_Name := "display-opened";
Emitted when a display is opened.