Next: , Previous: General, Up: Top


3 GdkDisplay

Controls the keyboard/mouse pointer grabs and a set of s

3.1 Overview

<gdk-display> objects purpose are two fold:

To grab/ungrab keyboard focus and mouse pointer

To manage and provide information about the <gdk-screen>(s) available for this <gdk-display>

<gdk-display> objects are the GDK representation of the 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 <gdk-screen> objects currently instanciated by the application. It is also used to grab and release the keyboard and the mouse pointer.

3.2 Usage

— Class: <gdk-display>

Derives from <gobject>.

This class defines no direct slots.

— Signal on <gdk-display>: closed (arg0 <gboolean>)

The ::closed signal is emitted when the connection to the windowing system for display is closed.

Since 2.2

— Function: gdk-display-open (display_name mchars) ⇒  (ret <gdk-display>)

Opens a display.

display-name
the name of the display to open
ret
a <gdk-display>, or ‘#f’ if the display could not be opened.

Since 2.2

— Function: gdk-display-get-default ⇒  (ret <gdk-display>)

Gets the default <gdk-display>. This is a convenience function for:

          
            gdk_display_manager_get_default_display (gdk_display_manager_get ())
ret
a <gdk-display>, or ‘#f’ if there is no default display.

Since 2.2

— Function: gdk-display-get-name (self <gdk-display>) ⇒  (ret mchars)
— Method: get-name

Gets the name of the display.

display
a <gdk-display>
ret
a string representing the display name. This string is owned by GDK and should not be modified or freed.

Since 2.2

— Function: gdk-display-get-n-screens (self <gdk-display>) ⇒  (ret int)
— Method: get-n-screens

Gets the number of screen managed by the display.

display
a <gdk-display>
ret
number of screens.

Since 2.2

— Function: gdk-display-get-screen (self <gdk-display>) (screen_num int) ⇒  (ret <gdk-screen>)
— Method: get-screen

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

display
a <gdk-display>
screen-num
the screen number
ret
the <gdk-screen> object

Since 2.2

— Function: gdk-display-get-default-screen (self <gdk-display>) ⇒  (ret <gdk-screen>)
— Method: get-default-screen

Get the default <gdk-screen> for display.

display
a <gdk-display>
ret
the default <gdk-screen> object for display

Since 2.2

— Function: gdk-display-pointer-ungrab (self <gdk-display>) (time_ unsigned-int32)
— Method: pointer-ungrab

Release any pointer grab.

display
a <gdk-display>.
time
a timestap (e.g. ‘GDK_CURRENT_TIME’).

Since 2.2

— Function: gdk-display-keyboard-ungrab (self <gdk-display>) (time_ unsigned-int32)
— Method: keyboard-ungrab

Release any keyboard grab

display
a <gdk-display>.
time
a timestap (e.g <gdk-current-time>).

Since 2.2

— Function: gdk-display-pointer-is-grabbed (self <gdk-display>) ⇒  (ret bool)
— Method: pointer-is-grabbed

Test if the pointer is grabbed.

display
a <gdk-display>
ret
#t’ if an active X pointer grab is in effect

Since 2.2

— Function: gdk-display-beep (self <gdk-display>)
— Method: beep

Emits a short beep on display

display
a <gdk-display>

Since 2.2

— Function: gdk-display-sync (self <gdk-display>)
— Method: 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-sync before gdk-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.

display
a <gdk-display>

Since 2.2

— Function: gdk-display-flush (self <gdk-display>)
— Method: 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 explicitely. 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.

display
a <gdk-display>

Since 2.4

— Function: gdk-display-close (self <gdk-display>)
— Method: close

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

display
a <gdk-display>

Since 2.2

— Function: gdk-display-list-devices (self <gdk-display>) ⇒  (ret glist-of)
— Method: list-devices

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

display
a <gdk-display>
ret
a list of <gdk-device>

Since 2.2

— Function: gdk-display-get-event (self <gdk-display>) ⇒  (ret <gdk-event>)
— Method: get-event

Gets the next <gdk-event> to be processed for display, fetching events from the windowing system if necessary.

display
a <gdk-display>
ret
the next <gdk-event> to be processed, or ‘#f’ if no events are pending. The returned <gdk-event> should be freed with gdk-event-free.

Since 2.2

— Function: gdk-display-peek-event (self <gdk-display>) ⇒  (ret <gdk-event>)
— Method: peek-event

Gets a copy of the first <gdk-event> 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.)

display
a <gdk-display>
ret
a copy of the first <gdk-event> on the event queue, or ‘#f’ if no events are in the queue. The returned <gdk-event> should be freed with gdk-event-free.

Since 2.2

— Function: gdk-display-put-event (self <gdk-display>) (event <gdk-event>)
— Method: put-event

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

display
a <gdk-display>
event
a <gdk-event>.

Since 2.2

— Function: gdk-display-set-double-click-time (self <gdk-display>) (msec unsigned-int)
— Method: set-double-click-time

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.

display
a <gdk-display>
msec
double click time in milliseconds (thousandths of a second)

Since 2.2

— Function: gdk-display-get-window-at-pointer (self <gdk-display>) ⇒  (ret <gdk-window>) (win_x int) (win_y int)
— Method: get-window-at-pointer

Obtains the window underneath the mouse pointer, returning the location of that window in win-x, win-y for screen. Returns ‘#f’ if the window under the mouse pointer is not known to GDK (for example, belongs to another application).

display
a <gdk-display>
win-x
return location for origin of the window under the pointer
win-y
return location for origin of the window under the pointer
ret
the window under the mouse pointer, or ‘#f

Since 2.2

— Function: gdk-display-warp-pointer (self <gdk-display>) (screen <gdk-screen>) (int) (int)
— Method: warp-pointer

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.

Note that the pointer should normally be under the control of the user. This function was added to cover some rare use cases like keyboard navigation support for the color picker in the <gtk-color-selection-dialog>.

display
a <gdk-display>
screen
the screen of display to warp the pointer to
x
the x coordinate of the destination
y
the y coordinate of the destination

Since 2.8

— Function: gdk-display-supports-cursor-color (self <gdk-display>) ⇒  (ret bool)
— Method: supports-cursor-color

Returns ‘#t’ if multicolored cursors are supported on display. Otherwise, cursors have only a forground and a background color.

display
a <gdk-display>
ret
whether cursors can have multiple colors.

Since 2.4

— Function: gdk-display-supports-cursor-alpha (self <gdk-display>) ⇒  (ret bool)
— Method: supports-cursor-alpha

Returns ‘#t’ if cursors can use an 8bit alpha channel on display. Otherwise, cursors are restricted to bilevel alpha (i.e. a mask).

display
a <gdk-display>
ret
whether cursors can have alpha channels.

Since 2.4

— Function: gdk-display-get-default-cursor-size (self <gdk-display>) ⇒  (ret unsigned-int)
— Method: get-default-cursor-size

Returns the default size to use for cursors on display.

display
a <gdk-display>
ret
the default cursor size.

Since 2.4

— Function: gdk-display-get-maximal-cursor-size (self <gdk-display>) ⇒  (width unsigned-int) (height unsigned-int)
— Method: get-maximal-cursor-size

Gets the maximal size to use for cursors on display.

display
a <gdk-display>
width
the return location for the maximal cursor width
height
the return location for the maximal cursor height

Since 2.4

— Function: gdk-display-get-default-group (self <gdk-display>) ⇒  (ret <gdk-window>)
— Method: get-default-group

Returns the default group leader window for all toplevel windows on display. This window is implicitly created by GDK. See gdk-window-set-group.

display
a <gdk-display>
ret
The default group leader window for display

Since 2.4

— Function: gdk-display-supports-shapes (self <gdk-display>) ⇒  (ret bool)
— Method: supports-shapes

Returns ‘#t’ if gdk-window-shape-combine-mask can be used to create shaped windows on display.

display
a <gdk-display>
ret
#t’ if shaped windows are supported

Since 2.10

— Function: gdk-display-supports-input-shapes (self <gdk-display>) ⇒  (ret bool)
— Method: supports-input-shapes

Returns ‘#t’ if gdk-window-input-shape-combine-mask can be used to modify the input shape of windows on display.

display
a <gdk-display>
ret
#t’ if windows with modified input shape are supported

Since 2.10