1.16 <GdkDisplayManager>

Class: <GdkDisplayManager>

It derives from <GObject>.

Offers notification when displays appear or disappear.

<GdkDisplayManager> is a singleton object.

You can use 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 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");

Properties

Property: display-manager:default-display self

The default display.

Its value is a <GdkDisplay>, or #f.

Set it with (set! (display-manager:default-display self) value).

Procedures

Procedure: display-manager:get ⇒ %return

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 set_allowed_backends to limit what backends will be used.

%return

Returned: a <GdkDisplayManager>.

The global <GdkDisplayManager> singleton

Method: display-manager:get-default-display self ⇒ %return
Method: get-default-display self ⇒ %return

Gets the default <GdkDisplay>.

self

Passed: a <GdkDisplayManager>.

a <GdkDisplayManager>

%return

Returned: a <GdkDisplay>, or #f.

a <GdkDisplay>

Method: display-manager:list-displays self ⇒ %return
Method: list-displays self ⇒ %return

List all currently open displays.

self

Passed: a <GdkDisplayManager>.

a <GdkDisplayManager>

%return

Returned: a list, each a <GdkDisplay>.

a newly allocated GSList of <GdkDisplay> objects

Method: display-manager:open-display self [name] ⇒ %return
Method: open-display self [name] ⇒ %return

Opens a display.

self

Passed: a <GdkDisplayManager>.

a <GdkDisplayManager>

name

Passed, or left out: a string, or #f.

the name of the display to open

%return

Returned: a <GdkDisplay>, or #f.

a <GdkDisplay>, or #f if the display could not be opened

Method: display-manager:set-default-display self display
Method: set-default-display self display

Sets display as the default display.

self

Passed: a <GdkDisplayManager>.

a <GdkDisplayManager>

display

Passed: a <GdkDisplay>.

a <GdkDisplay>

Signals

Signal: display-manager:display-opened

Connect a handler with (connect object display-manager:display-opened handler). It is called as (handler self display).

Emitted when a display is opened.

self

Passed: a <GdkDisplayManager>.

display

Passed: a <GdkDisplay>.

the opened display