gdk.display

Module for [Display] class

Types 3

[gdk.display.Display] objects are the GDK representation of a workstation.

Their purpose are two-fold:

  • To manage and provide information about input devices (pointers, keyboards, etc)
  • To manage and provide information about output devices (monitors, projectors, etc)

Most of the input device handling has been factored out into separate [gdk.seat.Seat] objects. Every display has a one or more seats, which can be accessed with [gdk.display.Display.getDefaultSeat] and [gdk.display.Display.listSeats].

Output devices are represented by [gdk.monitor.MonitorWrap] objects, which can be accessed with [gdk.display.Display.getMonitorAtSurface] and similar APIs.

Methods
GType _gType() @property
Display self()Returns `this`, for use in `with` statements.
DisplayGidBuilder builder()Get builder for [gdk.display.Display] Returns: New builder object
bool composited() @propertyGet `composited` property. Returns: true if the display properly composites the alpha channel.
gdk.dmabuf_formats.DmabufFormats dmabufFormats() @propertyGet `dmabufFormats` property. Returns: The dma-buf formats that are supported on this display
bool inputShapes() @propertyGet `inputShapes` property. Returns: true if the display supports input shapes.
bool rgba() @propertyGet `rgba` property. Returns: true if the display supports an alpha channel.
bool shadowWidth() @propertyGet `shadowWidth` property. Returns: true if the display supports extensible frames.
gdk.display.Display getDefault()Gets the default [gdk.display.Display].
gdk.display.Display open(string displayName = null)Opens a display.
void beep()Emits a short beep on display
void close()Closes the connection to the windowing system for the given display.
gdk.glcontext.GLContext createGlContext()Creates a new [gdk.glcontext.GLContext] for the [gdk.display.Display].
bool deviceIsGrabbed(gdk.device.Device device)Returns true if there is an ongoing grab on device for display.
void flush()Flushes any requests queued for the windowing system.
gdk.app_launch_context.AppLaunchContext getAppLaunchContext()Returns a [gdk.applaunchcontext.AppLaunchContext] suitable for launching applications on the given display. Returns: a new [gdk.applaunchcontext.AppLaunchContext] for display
gdk.clipboard.Clipboard getClipboard()Gets the clipboard used for copy/paste operations. Returns: the display's clipboard
gdk.seat.Seat getDefaultSeat()Returns the default [gdk.seat.Seat] for this display.
gdk.dmabuf_formats.DmabufFormats getDmabufFormats()Returns the dma-buf formats that are supported on this display.
gdk.monitor.MonitorWrap getMonitorAtSurface(gdk.surface.Surface surface)Gets the monitor in which the largest area of surface resides.
gio.list_model.ListModel getMonitors()Gets the list of monitors associated with this display.
string getName()Gets the name of the display. Returns: a string representing the display name. This string is owned by GDK and should not be modified or freed.
gdk.clipboard.Clipboard getPrimaryClipboard()Gets the clipboard used for the primary selection.
bool getSetting(string name, gobject.value.Value value)Retrieves a desktop-wide setting such as double-click time for the display.
string getStartupNotificationId()Gets the startup notification ID for a Wayland display, or null if no ID has been defined. Returns: the startup notification ID for display
bool isClosed()Finds out if the display has been closed. Returns: true if the display is closed.
bool isComposited()Returns whether surfaces can reasonably be expected to have their alpha channel drawn correctly on the screen.
bool isRgba()Returns whether surfaces on this display are created with an alpha channel.
gdk.seat.Seat[] listSeats()Returns the list of seats known to display. Returns: the list of seats known to the [gdk.display.Display]
bool mapKeycode(uint keycode, out gdk.types.KeymapKey[] keys, out uint[] keyvals)Returns the keyvals bound to keycode.
bool mapKeyval(uint keyval, out gdk.types.KeymapKey[] keys)Obtains a list of keycode/group/level combinations that will generate keyval.
void notifyStartupComplete(string startupId)Indicates to the GUI environment that the application has finished loading, using a given identifier.
bool prepareGl()Checks that OpenGL is available for self and ensures that it is properly initialized. When this fails, an error will be set describing the error and this function returns false.
void putEvent(gdk.event.Event event)Adds the given event to the event queue for display.
bool supportsInputShapes()Returns true if the display supports input shapes.
bool supportsShadowWidth()Returns whether it's possible for a surface to draw outside of the window area.
void sync()Flushes any requests queued for the windowing system and waits until all requests have been handled.
bool translateKey(uint keycode, gdk.types.ModifierType state, int group, out uint keyval, out int effectiveGroup, out int level, out gdk.types.ModifierType consumed)Translates the contents of a [gdk.event_key.EventKey] into a keyval, effective group, and level.
gulong connectClosed(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == bool))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gdk.display.Display))) && Parameters!T.length < 3)Connect to `Closed` signal.
gulong connectOpened(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gdk.display.Display))) && Parameters!T.length < 2)Connect to `Opened` signal.
gulong connectSeatAdded(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gdk.seat.Seat))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gdk.display.Display))) && Parameters!T.length < 3)Connect to `SeatAdded` signal.
gulong connectSeatRemoved(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gdk.seat.Seat))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gdk.display.Display))) && Parameters!T.length < 3)Connect to `SeatRemoved` signal.
gulong connectSettingChanged(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == string))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gdk.display.Display))) && Parameters!T.length < 3)Connect to `SettingChanged` signal.
Constructors
this(void * ptr, Flag!"Take" take)

Fluent builder for [gdk.display.Display]

Methods