gdk.display

Module for [Display] class

Types 3

#GdkDisplay objects purpose are two fold:

  • To manage and provide information about input devices (pointers and keyboards)
  • To manage and provide information about the available #GdkScreens

GdkDisplay objects are the GDK representation of an X Display, which can be described as a workstation consisting of a keyboard, a pointing device (such as a mouse) and one or more screens. It is used to open and keep track of various GdkScreen objects currently instantiated by the application. It is also used to access the keyboard(s) and mouse pointer(s) of the display.

Most of the input device handling has been factored out into the separate #GdkDeviceManager object. Every display has a device manager, which you can obtain using [gdk.display.Display.getDeviceManager].

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
gdk.display.Display getDefault()Gets the default #GdkDisplay. This is a convenience function for: `gdkdisplaymanagergetdefaultdisplay (gdkdisplaymanagerget ())`. Returns: a #GdkDisplay, or null if there is no default display.
gdk.display.Display open(string displayName)Opens a display.
gdk.display.Display openDefaultLibgtkOnly()Opens the default display specified by command line arguments or environment variables, sets it as the default display, and returns it. [gdk.global.parseArgs] must have been called first. If the de...
void beep()Emits a short beep on display
void close()Closes the connection to the windowing system for the given display, and cleans up associated resources.
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; this happens automatically when the main loop blocks waiting for new events, but if your application is drawing without returning control to th...
gdk.app_launch_context.AppLaunchContext getAppLaunchContext()Returns a #GdkAppLaunchContext suitable for launching applications on the given display. Returns: a new #GdkAppLaunchContext for display. Free with [gobject.object.ObjectWrap.unref] when done
uint getDefaultCursorSize()Returns the default size to use for cursors on display. Returns: the default cursor size.
gdk.window.Window getDefaultGroup()Returns the default group leader window for all toplevel windows on display. This window is implicitly created by GDK. See [gdk.window.Window.setGroup]. Returns: The default group leader window for...
gdk.screen.Screen getDefaultScreen()Get the default #GdkScreen for display. Returns: the default #GdkScreen object for display
gdk.seat.Seat getDefaultSeat()Returns the default #GdkSeat for this display. Returns: the default seat.
gdk.device_manager.DeviceManager getDeviceManager()Returns the #GdkDeviceManager associated to display. Returns: A #GdkDeviceManager, or null. This memory is owned by GDK and must not be freed or unreferenced.
gdk.event.Event getEvent()Gets the next #GdkEvent to be processed for display, fetching events from the windowing system if necessary. Returns: the next #GdkEvent to be processed, or null if no events are pending. The retur...
void getMaximalCursorSize(out uint width, out uint height)Gets the maximal size to use for cursors on display.
gdk.monitor.MonitorWrap getMonitor(int monitorNum)Gets a monitor associated with this display.
gdk.monitor.MonitorWrap getMonitorAtPoint(int x, int y)Gets the monitor in which the point (`x`, `y`) is located, or a nearby monitor if the point is not in any monitor.
gdk.monitor.MonitorWrap getMonitorAtWindow(gdk.window.Window window)Gets the monitor in which the largest area of window resides, or a monitor close to window if it is outside of all monitors.
int getNMonitors()Gets the number of monitors that belong to display.
int getNScreens()Gets the number of screen managed by the display. Returns: number of screens.
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.
void getPointer(out gdk.screen.Screen screen, out int x, out int y, out gdk.types.ModifierType mask)Gets the current location of the pointer and the current modifier mask for a given display.
gdk.monitor.MonitorWrap getPrimaryMonitor()Gets the primary monitor for the display.
gdk.screen.Screen getScreen(int screenNum)Returns a screen object for one of the screens of the display.
gdk.window.Window getWindowAtPointer(out int winX, out int winY)Obtains the window underneath the mouse pointer, returning the location of the pointer in that window in winx, winy for screen. Returns null if the window under the mouse pointer is not known to GD...
bool hasPending()Returns whether the display has events that are waiting to be processed. Returns: true if there are events ready to be processed.
bool isClosed()Finds out if the display has been closed. Returns: true if the display is closed.
void keyboardUngrab(uint time)Release any keyboard grab
gdk.device.Device[] listDevices()Returns the list of available input devices attached to display. The list is statically allocated and should not be freed. Returns: a list of #GdkDevice
gdk.seat.Seat[] listSeats()Returns the list of seats known to display. Returns: the list of seats known to the #GdkDisplay
void notifyStartupComplete(string startupId)Indicates to the GUI environment that the application has finished loading, using a given identifier.
gdk.event.Event peekEvent()Gets a copy of the first #GdkEvent in the display’s event queue, without removing the event from the queue. (Note that this function will not get more events from the windowing system. It only ...
bool pointerIsGrabbed()Test if the pointer is grabbed. Returns: true if an active X pointer grab is in effect
void pointerUngrab(uint time)Release any pointer grab.
void putEvent(gdk.event.Event event)Appends a copy of the given event onto the front of the event queue for display.
bool requestSelectionNotification(gdk.atom.Atom selection)Request #GdkEventOwnerChange events for ownership changes of the selection named by the given atom.
void setDoubleClickDistance(uint distance)Sets the double click distance (two clicks within this distance count as a double click and result in a #GDK2BUTTONPRESS event). See also [gdk.display.Display.setDoubleClickTime]. Applications shou...
void setDoubleClickTime(uint msec)Sets the double click time (two clicks within this time interval count as a double click and result in a #GDK2BUTTONPRESS event). Applications should not set this, it is a global user-configured se...
bool supportsClipboardPersistence()Returns whether the speicifed display supports clipboard persistance; i.e. if it’s possible to store the clipboard data after an application has quit. On X11 this checks if a clipboard daemon is ...
bool supportsComposite()Returns true if [gdk.window.Window.setComposited] can be used to redirect drawing on the window using compositing.
bool supportsCursorAlpha()Returns true if cursors can use an 8bit alpha channel on display. Otherwise, cursors are restricted to bilevel alpha (i.e. a mask). Returns: whether cursors can have alpha channels.
bool supportsCursorColor()Returns true if multicolored cursors are supported on display. Otherwise, cursors have only a forground and a background color. Returns: whether cursors can have multiple colors.
bool supportsInputShapes()Returns true if gdkwindowinputshapecombine_mask() can be used to modify the input shape of windows on display. Returns: true if windows with modified input shape are supported
bool supportsSelectionNotification()Returns whether #GdkEventOwnerChange events will be sent when the owner of a selection changes. Returns: whether #GdkEventOwnerChange events will be sent.
bool supportsShapes()Returns true if gdkwindowshapecombinemask() can be used to create shaped windows on display. Returns: true if shaped windows are supported
void sync()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 th...
void warpPointer(gdk.screen.Screen screen, int x, int y)Warps the pointer of display to the point `x`,`y` on the screen screen, unless the pointer is confined to a window by a grab, in which case it will be moved as far as allowed by the grab. Warping t...
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 connectMonitorAdded(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.monitor.MonitorWrap))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gdk.display.Display))) && Parameters!T.length < 3)Connect to `MonitorAdded` signal.
gulong connectMonitorRemoved(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.monitor.MonitorWrap))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gdk.display.Display))) && Parameters!T.length < 3)Connect to `MonitorRemoved` 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.
Constructors
this(void * ptr, Flag!"Take" take)

Fluent builder for [gdk.display.Display]

Methods