It derives from <GObject>.
A representation of a workstation.
Their purpose are two-fold:
Most of the input device handling has been factored out into separate
<GdkSeat> objects. Every display has a one or more
seats, which can be accessed with display:get-default-seat and display:list-seats.
Output devices are represented by <GdkMonitor>
objects, which can be accessed with display:get-monitor-at-surface and similar
APIs.
#t if the display properly composites the alpha channel.
Its value is a boolean.
It is read only.
The dma-buf formats that are supported on this display
Its value is a <GdkDmabufFormats>, or
#f.
It is read only.
#t if the display supports input shapes.
Its value is a boolean.
It is read only.
#t if the display supports an alpha channel.
Its value is a boolean.
It is read only.
#t if the display supports extensible frames.
Its value is a boolean.
It is read only.
Emits a short beep on self
Passed: a <GdkDisplay>.
Closes the connection to the windowing system for the given display.
This cleans up associated resources.
Passed: a <GdkDisplay>.
Creates a new <GdkGLContext> for the
<GdkDisplay>.
The context is disconnected from any particular surface or surface and cannot be used to draw to any surface. It can only be used to draw to non-surface framebuffers like textures.
If the creation of the <GdkGLContext> failed,
error will be set. Before using the returned
<GdkGLContext>, you will need to call
glcontext:make-current or
glcontext:realize?.
Passed: a <GdkDisplay>.
Returned: a <GdkGLContext>.
the newly created <GdkGLContext>
Returns #t if there is an ongoing grab on device for
self.
Passed: a <GdkDisplay>.
Passed: a <GdkDevice>.
Returned: a boolean.
#t if there is a grab in effect for device.
Flushes any requests queued for the windowing system.
This happens automatically when the main loop blocks waiting for new events, but if your application is drawing without returning control to the main loop, you may need to call this function explicitly. A common case where this function needs to be called is when an application is executing drawing commands from a thread other than the thread where the main loop is running.
This is most useful for X11. On windowing systems where requests are handled synchronously, this function will do nothing.
Passed: a <GdkDisplay>.
Returns a <GdkAppLaunchContext> suitable
for launching applications on the given display.
Passed: a <GdkDisplay>.
Returned: a <GdkAppLaunchContext>.
a new <GdkAppLaunchContext> for
self
Gets the clipboard used for copy/paste operations.
Passed: a <GdkDisplay>.
Returned: a <GdkClipboard>.
the display’s clipboard
Gets the default <GdkDisplay>.
This is a convenience function for:
gdk_display_manager_get_default_display (gdk_display_manager_get ())
Returned: a <GdkDisplay>, or #f.
a <GdkDisplay>, or #f if there is no
default display
Returns the default <GdkSeat> for this display.
Note that a display may not have a seat. In this case, this function
will return #f.
Passed: a <GdkDisplay>.
Returned: a <GdkSeat>, or #f.
the default seat.
Returns the dma-buf formats that are supported on this display.
GTK may use OpenGL or Vulkan to support some formats. Calling this function will then initialize them if they aren’t yet.
The formats returned by this function can be used for negotiating buffer formats with producers such as v4l, pipewire or GStreamer.
To learn more about dma-bufs, see
<GdkDmabufTextureBuilder>.
This function is threadsafe. It can be called from any thread.
Passed: a <GdkDisplay>.
Returned: a <GdkDmabufFormats>.
a <GdkDmabufFormats> object
Gets the monitor in which the largest area of surface resides.
Passed: a <GdkDisplay>.
Passed: a <GdkSurface>.
Returned: a <GdkMonitor>, or #f.
the monitor with the largest overlap with surface
Gets the list of monitors associated with this display.
Subsequent calls to this function will always return the same list for the same display.
You can listen to the GListModel::items-changed signal on this list to monitor changes to the monitor of this display.
Passed: a <GdkDisplay>.
Returned: a <GListModel>.
a <GListModel> of
<GdkMonitor>
Gets the name of the display.
Passed: a <GdkDisplay>.
Returned: a string.
a string representing the display name. This string is owned by GDK and should not be modified or freed.
Gets the clipboard used for the primary selection.
On backends where the primary clipboard is not supported natively, GDK emulates this clipboard locally.
Passed: a <GdkDisplay>.
Returned: a <GdkClipboard>.
the primary clipboard
Retrieves a desktop-wide setting such as double-click time for the self.
Passed: a <GdkDisplay>.
Passed: a string.
the name of the setting
Passed: a <GValue>.
location to store the value of the setting
Returned: a boolean.
#t if the setting existed and a value was stored in value,
#f otherwise
Gets the startup notification ID for a Wayland display, or #f if
no ID has been defined.
Passed: a <GdkDisplay>.
Returned: a string, or #f.
the startup notification ID for self
Finds out if the display has been closed.
Passed: a <GdkDisplay>.
Returned: a boolean.
#t if the display is closed.
Returns whether surfaces can reasonably be expected to have their alpha channel drawn correctly on the screen.
Check display:is-rgba? for whether the
display supports an alpha channel.
On X11 this function returns whether a compositing manager is compositing on self.
On modern displays, this value is always #t.
Passed: a <GdkDisplay>.
Returned: a boolean.
Whether surfaces with RGBA visuals can reasonably be expected to have their alpha channels drawn correctly on the screen.
Returns whether surfaces on this self are created with an alpha channel.
Even if a #t is returned, it is possible that the surface’s alpha
channel won’t be honored when displaying the surface on the screen: in
particular, for X an appropriate windowing manager and compositing
manager must be running to provide appropriate display. Use
display:is-composited? to check if
that is the case.
On modern displays, this value is always #t.
Passed: a <GdkDisplay>.
Returned: a boolean.
#t if surfaces are created with an alpha channel or #f if
the display does not support this functionality.
Returns the list of seats known to self.
Passed: a <GdkDisplay>.
Returned: a list, each a <GdkSeat>.
the list of seats known to the <GdkDisplay>
Returns the keyvals bound to keycode.
The Nth <GdkKeymapKey> in keys is bound to
the Nth keyval in keyvals.
When a keycode is pressed by the user, the keyval from this list of entries is selected by considering the effective keyboard group and level.
Free the returned arrays with byte-array:free.
Passed: a <GdkDisplay>.
Passed: an unsigned 32-bit integer.
a keycode
Returned: a boolean.
#t if there were any entries
Returned: a vector, each a <GdkKeymapKey>.
return location for array of <GdkKeymapKey>
Returned: an u32vector.
return location for array of keyvals
Not returned: it is the length of keyvals.
length of keys and keyvals
Obtains a list of keycode/group/level combinations that will generate keyval.
Groups and levels are two kinds of keyboard mode; in general, the level determines whether the top or bottom symbol on a key is used, and the group determines whether the left or right symbol is used.
On US keyboards, the shift key changes the keyboard level, and there are no groups. A group switch key might convert a keyboard between Hebrew to English modes, for example.
GdkEventKey contains a group field that indicates the
active keyboard group. The level is computed from the modifier mask.
The returned array should be freed with
byte-array:free.
Passed: a <GdkDisplay>.
Passed: an unsigned 32-bit integer.
a keyval, such as GDK_KEY_a, GDK_KEY_Up,
GDK_KEY_Return, etc.
Returned: a boolean.
#t if keys were found and returned
Returned: a vector, each a <GdkKeymapKey>.
return location for an array of <GdkKeymapKey>
Not returned: it is the length of keys.
return location for number of elements in returned array
Indicates to the GUI environment that the application has finished loading, using a given identifier.
GTK will call this function automatically for GtkWindow with custom startup-notification identifier unless gtk_window_set_auto_startup_notification() is called to disable that feature.
Passed: a <GdkDisplay>.
Passed: a string.
a startup-notification identifier, for which notification process should be completed
Opens a display.
If opening the display fails, NULL is returned.
Passed, or left out: a string, or #f.
the name of the display to open
Returned: a <GdkDisplay>, or #f.
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 #f.
Note that even if this function succeeds, creating a
<GdkGLContext> may still fail.
This function is idempotent. Calling it multiple times will just return the same value or error.
You never need to call this function, GDK will call it automatically as needed. But you can use it as a check when setting up code that might make use of OpenGL.
Passed: a <GdkDisplay>.
Returned: a boolean.
#t if the display supports OpenGL
Adds the given event to the event queue for self.
Passed: a <GdkDisplay>.
Passed: a <GdkEvent>.
Returns #t if the display supports input shapes.
This means that surface:set-input-region can be used to modify the
input shape of surfaces on self.
On modern displays, this value is always #t.
Passed: a <GdkDisplay>.
Returned: a boolean.
#t if surfaces with modified input shape are supported
Returns whether it’s possible for a surface to draw outside of the window area.
If #t is returned the application decides if it wants to draw
shadows. If #f is returned, the compositor decides if it wants
to draw shadows.
Passed: a <GdkDisplay>.
Returned: a boolean.
#t if surfaces can draw shadows or #f if the display does
not support this functionality.
Flushes any requests queued for the windowing system and waits until all requests have been handled.
This is often used for making sure that the display is synchronized with
the current state of the program. Calling display:sync before GdkX11.Display.error_trap_pop makes
sure that any errors generated from earlier requests are handled before
the error trap is removed.
This is most useful for X11. On windowing systems where requests are handled synchronously, this function will do nothing.
Passed: a <GdkDisplay>.
Translates the contents of a GdkEventKey into a keyval, effective
group, and level.
Modifiers that affected the translation and are thus unavailable for application use are returned in consumed-modifiers.
The effective-group is the group that was actually used for the translation; some keys such as Enter are not affected by the active keyboard group. The level is derived from state.
consumed-modifiers gives modifiers that should be masked out from
state when comparing this key press to a keyboard shortcut. For
instance, on a US keyboard, the plus symbol is shifted, so when
comparing a key press to a <Control>plus accelerator
<Shift> should be masked out.
This function should rarely be needed, since GdkEventKey already
contains the translated keyval. It is exported for the benefit of
virtualized test environments.
Passed: a <GdkDisplay>.
Passed: an unsigned 32-bit integer.
a keycode
Passed: a <GdkModifierType>, or a list of its
symbols, or one of them.
a modifier state
Passed: a 32-bit integer.
active keyboard group
Returned: a boolean.
#t if there was a keyval bound to keycode/state/group.
Returned: an unsigned 32-bit integer.
return location for keyval
Returned: a 32-bit integer.
return location for effective group
Returned: a 32-bit integer.
return location for level
Returned: a <GdkModifierType>.
return location for modifiers that were used to determine the group or level
Connect a handler with (connect object display:closed handler).
It is called as (handler self is-error).
Emitted when the connection to the windowing system for display is closed.
Passed: a <GdkDisplay>.
Passed: a boolean.
#t if the display was closed due to an error
Connect a handler with (connect object display:opened handler).
It is called as (handler self).
Emitted when the connection to the windowing system for display is opened.
Passed: a <GdkDisplay>.
Connect a handler with (connect object display:seat-added
handler). It is called as (handler self seat).
Emitted whenever a new seat is made known to the windowing system.
Passed: a <GdkDisplay>.
Passed: a <GdkSeat>.
the seat that was just added
Connect a handler with (connect object display:seat-removed
handler). It is called as (handler self seat).
Emitted whenever a seat is removed by the windowing system.
Passed: a <GdkDisplay>.
Passed: a <GdkSeat>.
the seat that was just removed
Connect a handler with (connect object display:setting-changed
handler). It is called as (handler self setting).
Emitted whenever a setting changes its value.
Passed: a <GdkDisplay>.
Passed: a string.
the name of the setting that changed