DisplayManager

open class DisplayManager(pointer: <Error class: unknown class><<Error class: unknown class>>)

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

You can use func@Gdk.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 func@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");

Skipped during bindings generation

  • method default-display: Property TypeInfo of getter and setter do not match

Constructors

Link copied to clipboard
constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val gdkDisplayManagerPointer: <Error class: unknown class><<Error class: unknown class>>

Functions

Link copied to clipboard
fun connectDisplayOpened(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (display: Display) -> Unit): <Error class: unknown class>

Emitted when a display is opened.

Link copied to clipboard

Gets the default GdkDisplay.

Link copied to clipboard
open fun listDisplays(): <Error class: unknown class>

List all currently open displays.

Link copied to clipboard
open fun openDisplay(name: String? = null): Display?

Opens a display.

Link copied to clipboard
open fun setDefaultDisplay(display: Display)

Sets @display as the default display.