### Class

# Gdk DisplayManager

since: 4.0

#### Description [src]

    final class Gdk.DisplayManager : GObject.Object
    {
      /* No available fields */
    }

A singleton object that offers notification when displays appear or disappear.

You can use `gdk_display_manager_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 `gdk_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:

    #ifdef GDK_WINDOWING_X11
      if (GDK_IS_X11_DISPLAY (display))
        {
          // make 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");

Available since: 4.0

#### Ancestors

- GObject

#### Functions

###### gdk_display_manager_get

Gets the singleton `GdkDisplayManager` object.

since: 4.0

#### Instance methods

###### gdk_display_manager_get_default_display

Gets the default `GdkDisplay`.

since: 4.0

###### gdk_display_manager_list_displays

List all currently open displays.

since: 4.0

###### gdk_display_manager_open_display

Opens a display.

since: 4.0

###### gdk_display_manager_set_default_display

Sets `display` as the default display.

since: 4.0

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Properties

###### Gdk.DisplayManager:default-display

The default display.

since: 4.0

#### Signals

###### Gdk.DisplayManager::display-opened

Emitted when a display is opened.

since: 4.0

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

since: 2.0