Display

#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.

class Display : ObjectWrap {}

Constructors

this
this(void* ptr, Flag!"Take" take)

Members

Functions

beep
void beep()

Emits a short beep on display

close
void close()

Closes the connection to the windowing system for the given display, and cleans up associated resources.

connectClosed
gulong connectClosed(T callback, Flag!"After" after)

Connect to Closed signal.

connectMonitorAdded
gulong connectMonitorAdded(T callback, Flag!"After" after)

Connect to MonitorAdded signal.

connectMonitorRemoved
gulong connectMonitorRemoved(T callback, Flag!"After" after)

Connect to MonitorRemoved signal.

connectOpened
gulong connectOpened(T callback, Flag!"After" after)

Connect to Opened signal.

connectSeatAdded
gulong connectSeatAdded(T callback, Flag!"After" after)

Connect to SeatAdded signal.

connectSeatRemoved
gulong connectSeatRemoved(T callback, Flag!"After" after)

Connect to SeatRemoved signal.

deviceIsGrabbed
bool deviceIsGrabbed(gdk.device.Device device)

Returns true if there is an ongoing grab on device for display.

flush
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 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.

getAppLaunchContext
gdk.app_launch_context.AppLaunchContext getAppLaunchContext()

Returns a #GdkAppLaunchContext suitable for launching applications on the given display.

getDefaultCursorSize
uint getDefaultCursorSize()

Returns the default size to use for cursors on display.

getDefaultGroup
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.

getDefaultScreen
gdk.screen.Screen getDefaultScreen()

Get the default #GdkScreen for display.

getDefaultSeat
gdk.seat.Seat getDefaultSeat()

Returns the default #GdkSeat for this display.

getDeviceManager
gdk.device_manager.DeviceManager getDeviceManager()

Returns the #GdkDeviceManager associated to display.

getEvent
gdk.event.Event getEvent()

Gets the next #GdkEvent to be processed for display, fetching events from the windowing system if necessary.

getMaximalCursorSize
void getMaximalCursorSize(uint width, uint height)

Gets the maximal size to use for cursors on display.

getMonitor
gdk.monitor.MonitorWrap getMonitor(int monitorNum)

Gets a monitor associated with this display.

getMonitorAtPoint
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.

getMonitorAtWindow
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.

getNMonitors
int getNMonitors()

Gets the number of monitors that belong to display.

getNScreens
int getNScreens()

Gets the number of screen managed by the display.

getName
string getName()

Gets the name of the display.

getPointer
void getPointer(gdk.screen.Screen screen, int x, int y, gdk.types.ModifierType mask)

Gets the current location of the pointer and the current modifier mask for a given display.

getPrimaryMonitor
gdk.monitor.MonitorWrap getPrimaryMonitor()

Gets the primary monitor for the display.

getScreen
gdk.screen.Screen getScreen(int screenNum)

Returns a screen object for one of the screens of the display.

getWindowAtPointer
gdk.window.Window getWindowAtPointer(int winX, int winY)

Obtains the window underneath the mouse pointer, returning the location of the pointer in that window in win_x, win_y for screen. Returns null if the window under the mouse pointer is not known to GDK (for example, belongs to another application).

hasPending
bool hasPending()

Returns whether the display has events that are waiting to be processed.

isClosed
bool isClosed()

Finds out if the display has been closed.

keyboardUngrab
void keyboardUngrab(uint time)

Release any keyboard grab

listDevices
gdk.device.Device[] listDevices()

Returns the list of available input devices attached to display. The list is statically allocated and should not be freed.

listSeats
gdk.seat.Seat[] listSeats()

Returns the list of seats known to display.

notifyStartupComplete
void notifyStartupComplete(string startupId)

Indicates to the GUI environment that the application has finished loading, using a given identifier.

peekEvent
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 checks the events that have already been moved to the GDK event queue.)

pointerIsGrabbed
bool pointerIsGrabbed()

Test if the pointer is grabbed.

pointerUngrab
void pointerUngrab(uint time)

Release any pointer grab.

putEvent
void putEvent(gdk.event.Event event)

Appends a copy of the given event onto the front of the event queue for display.

requestSelectionNotification
bool requestSelectionNotification(gdk.atom.Atom selection)

Request #GdkEventOwnerChange events for ownership changes of the selection named by the given atom.

self
Display self()

Returns this, for use in with statements.

setDoubleClickDistance
void setDoubleClickDistance(uint distance)

Sets the double click distance (two clicks within this distance count as a double click and result in a #GDK_2BUTTON_PRESS event). See also gdk.display.Display.setDoubleClickTime. Applications should not set this, it is a global user-configured setting.

setDoubleClickTime
void setDoubleClickTime(uint msec)

Sets the double click time (two clicks within this time interval count as a double click and result in a #GDK_2BUTTON_PRESS event). Applications should not set this, it is a global user-configured setting.

supportsClipboardPersistence
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 running.

supportsComposite
bool supportsComposite()

Returns true if gdk.window.Window.setComposited can be used to redirect drawing on the window using compositing.

supportsCursorAlpha
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).

supportsCursorColor
bool supportsCursorColor()

Returns true if multicolored cursors are supported on display. Otherwise, cursors have only a forground and a background color.

supportsInputShapes
bool supportsInputShapes()

Returns true if gdk_window_input_shape_combine_mask() can be used to modify the input shape of windows on display.

supportsSelectionNotification
bool supportsSelectionNotification()

Returns whether #GdkEventOwnerChange events will be sent when the owner of a selection changes.

supportsShapes
bool supportsShapes()

Returns true if gdk_window_shape_combine_mask() can be used to create shaped windows on display.

sync
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 the program. Calling gdk.display.Display.sync before gdk.global.errorTrapPop makes sure that any errors generated from earlier requests are handled before the error trap is removed.

warpPointer
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 the pointer creates events as if the user had moved the mouse instantaneously to the destination.

Properties

_gType
GType _gType [@property getter]

Static functions

_getGType
GType _getGType()
builder
DisplayGidBuilder builder()

Get builder for gdk.display.Display

getDefault
gdk.display.Display getDefault()

Gets the default #GdkDisplay. This is a convenience function for: gdk_display_manager_get_default_display (gdk_display_manager_get ()).

open
gdk.display.Display open(string displayName)

Opens a display.

openDefaultLibgtkOnly
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 default display has previously been set, simply returns that. An internal function that should not be used by applications.

Inherited Members

From ObjectWrap

_setGObject
void _setGObject(void* cObj, Flag!"Take" take)

Set the GObject of a D ObjectWrap wrapper.

_cPtr
void* _cPtr(Flag!"Dup" dup)

Get a pointer to the underlying C object.

_ref
void* _ref(void* gObj)

Calls g_object_ref() on a GObject.

_unref
_unref(void* gObj)

Calls g_object_unref() on a GObject.

_getGType
GType _getGType()

Get the GType of an object.

_gType
GType _gType [@property getter]

GObject GType property.

self
ObjectWrap self()

Convenience method to return this cast to a type. For use in D with statements.

_getDObject
T _getDObject(void* cptr, Flag!"Take" take)

Template to get the D object from a C GObject and cast it to the given D object type.

connectSignalClosure
gulong connectSignalClosure(string signalDetail, DClosure closure, Flag!"After" after)

Connect a D closure to an object signal.

setProperty
void setProperty(string propertyName, T val)

Template for setting a GObject property.

getProperty
T getProperty(string propertyName)

Template for getting a GObject property.

compatControl
size_t compatControl(size_t what, void* data)
bindProperty
gobject.binding.Binding bindProperty(string sourceProperty, gobject.object.ObjectWrap target, string targetProperty, gobject.types.BindingFlags flags)

Creates a binding between source_property on source and target_property on target.

bindPropertyFull
gobject.binding.Binding bindPropertyFull(string sourceProperty, gobject.object.ObjectWrap target, string targetProperty, gobject.types.BindingFlags flags, gobject.closure.Closure transformTo, gobject.closure.Closure transformFrom)

Creates a binding between source_property on source and target_property on target, allowing you to set the transformation functions to be used by the binding.

forceFloating
void forceFloating()

This function is intended for #GObject implementations to re-enforce a floating[floating-ref] object reference. Doing this is seldom required: all #GInitiallyUnowneds are created with a floating reference which usually just needs to be sunken by calling gobject.object.ObjectWrap.refSink.

freezeNotify
void freezeNotify()

Increases the freeze count on object. If the freeze count is non-zero, the emission of "notify" signals on object is stopped. The signals are queued until the freeze count is decreased to zero. Duplicate notifications are squashed so that at most one #GObject::notify signal is emitted for each property modified while the object is frozen.

getData
void* getData(string key)

Gets a named field from the objects table of associations (see gobject.object.ObjectWrap.setData).

getProperty
void getProperty(string propertyName, gobject.value.Value value)

Gets a property of an object.

getQdata
void* getQdata(glib.types.Quark quark)

This function gets back user data pointers stored via gobject.object.ObjectWrap.setQdata.

getv
void getv(string[] names, gobject.value.Value[] values)

Gets n_properties properties for an object. Obtained properties will be set to values. All properties must be valid. Warnings will be emitted and undefined behaviour may result if invalid properties are passed in.

isFloating
bool isFloating()

Checks whether object has a floating[floating-ref] reference.

notify
void notify(string propertyName)

Emits a "notify" signal for the property property_name on object.

notifyByPspec
void notifyByPspec(gobject.param_spec.ParamSpec pspec)

Emits a "notify" signal for the property specified by pspec on object.

refSink
gobject.object.ObjectWrap refSink()

Increase the reference count of object, and possibly remove the floating[floating-ref] reference, if object has a floating reference.

runDispose
void runDispose()

Releases all references to other objects. This can be used to break reference cycles.

setData
void setData(string key, void* data)

Each object carries around a table of associations from strings to pointers. This function lets you set an association.

setProperty
void setProperty(string propertyName, gobject.value.Value value)

Sets a property on an object.

stealData
void* stealData(string key)

Remove a specified datum from the object's data associations, without invoking the association's destroy handler.

stealQdata
void* stealQdata(glib.types.Quark quark)

This function gets back user data pointers stored via gobject.object.ObjectWrap.setQdata and removes the data from object without invoking its destroy() function (if any was set). Usually, calling this function is only required to update user data pointers with a destroy notifier, for example:

thawNotify
void thawNotify()

Reverts the effect of a previous call to gobject.object.ObjectWrap.freezeNotify. The freeze count is decreased on object and when it reaches zero, queued "notify" signals are emitted.

watchClosure
void watchClosure(gobject.closure.Closure closure)

This function essentially limits the life time of the closure to the life time of the object. That is, when the object is finalized, the closure is invalidated by calling gobject.closure.Closure.invalidate on it, in order to prevent invocations of the closure with a finalized (nonexisting) object. Also, gobject.object.ObjectWrap.ref_ and gobject.object.ObjectWrap.unref are added as marshal guards to the closure, to ensure that an extra reference count is held on object during invocation of the closure. Usually, this function will be called on closures that use this object as closure data.

connectNotify
gulong connectNotify(string detail, T callback, Flag!"After" after)

Connect to Notify signal.