| Top |
| void | closed | Run Last |
| void | monitor-added | Run Last |
| void | monitor-removed | Run Last |
| void | opened | Run Last |
| void | seat-added | Run Last |
| void | seat-removed | Run Last |
CdkDisplay objects purpose are two fold:
To manage and provide information about input devices (pointers and keyboards)
To manage and provide information about the available CdkScreens
CdkDisplay objects are the CDK 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 CdkScreen 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 CdkDeviceManager object. Every display has a
device manager, which you can obtain using
cdk_display_get_device_manager().
CdkDisplay *
cdk_display_open (const gchar *display_name);
Opens a display.
Since: 2.2
CdkDisplay *
cdk_display_get_default (void);
Gets the default CdkDisplay. This is a convenience
function for:
cdk_display_manager_get_default_display (.cdk_display_manager_get())
Since: 2.2
const gchar *
cdk_display_get_name (CdkDisplay *display);
Gets the name of the display.
a string representing the display name. This string is owned by CDK and should not be modified or freed.
Since: 2.2
gint
cdk_display_get_n_screens (CdkDisplay *display);
cdk_display_get_n_screens has been deprecated since version 3.10 and should not be used in newly-written code.
The number of screens is always 1.
Gets the number of screen managed by the display
.
Since: 2.2
CdkScreen * cdk_display_get_screen (CdkDisplay *display,gint screen_num);
cdk_display_get_screen has been deprecated since version 3.20 and should not be used in newly-written code.
There is only one screen; use cdk_display_get_default_screen() to get it.
Returns a screen object for one of the screens of the display.
Since: 2.2
CdkScreen *
cdk_display_get_default_screen (CdkDisplay *display);
Get the default CdkScreen for display
.
Since: 2.2
CdkDeviceManager *
cdk_display_get_device_manager (CdkDisplay *display);
cdk_display_get_device_manager has been deprecated since version 3.20. and should not be used in newly-written code.
Use cdk_display_get_default_seat() and CdkSeat operations.
Returns the CdkDeviceManager associated to display
.
A CdkDeviceManager, or
NULL. This memory is owned by CDK and must not be freed
or unreferenced.
[nullable][transfer none]
Since: 3.0
void cdk_display_pointer_ungrab (CdkDisplay *display,guint32 time_);
Release any pointer grab.
Since: 2.2
void cdk_display_keyboard_ungrab (CdkDisplay *display,guint32 time_);
Release any keyboard grab
Since: 2.2
gboolean
cdk_display_pointer_is_grabbed (CdkDisplay *display);
Test if the pointer is grabbed.
Since: 2.2
gboolean cdk_display_device_is_grabbed (CdkDisplay *display,CdkDevice *device);
Returns TRUE if there is an ongoing grab on device
for display
.
void
cdk_display_beep (CdkDisplay *display);
Emits a short beep on display
Since: 2.2
void
cdk_display_sync (CdkDisplay *display);
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
cdk_display_sync() before cdk_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.
Since: 2.2
void
cdk_display_flush (CdkDisplay *display);
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.
Since: 2.4
void
cdk_display_close (CdkDisplay *display);
Closes the connection to the windowing system for the given display, and cleans up associated resources.
Since: 2.2
gboolean
cdk_display_is_closed (CdkDisplay *display);
Finds out if the display has been closed.
Since: 2.22
CdkEvent *
cdk_display_get_event (CdkDisplay *display);
Gets the next CdkEvent to be processed for display
, fetching events from the
windowing system if necessary.
the next CdkEvent to be processed, or NULL
if no events are pending. The returned CdkEvent should be freed
with cdk_event_free().
[nullable]
Since: 2.2
CdkEvent *
cdk_display_peek_event (CdkDisplay *display);
Gets a copy of the first CdkEvent 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 CDK event queue.)
a copy of the first CdkEvent on the event
queue, or NULL if no events are in the queue. The returned
CdkEvent should be freed with cdk_event_free().
[nullable]
Since: 2.2
void cdk_display_put_event (CdkDisplay *display,const CdkEvent *event);
Appends a copy of the given event onto the front of the event
queue for display
.
Since: 2.2
gboolean
cdk_display_has_pending (CdkDisplay *display);
Returns whether the display has events that are waiting to be processed.
Since: 3.0
void cdk_display_set_double_click_time (CdkDisplay *display,guint msec);
Sets the double click time (two clicks within this time interval count as a double click and result in a CDK_2BUTTON_PRESS event). Applications should not set this, it is a global user-configured setting.
Since: 2.2
void cdk_display_set_double_click_distance (CdkDisplay *display,guint distance);
Sets the double click distance (two clicks within this distance
count as a double click and result in a CDK_2BUTTON_PRESS event).
See also cdk_display_set_double_click_time().
Applications should not set this, it is a global
user-configured setting.
Since: 2.4
void cdk_display_get_pointer (CdkDisplay *display,CdkScreen **screen,gint *x,gint *y,CdkModifierType *mask);
Gets the current location of the pointer and the current modifier mask for a given display.
display |
||
screen |
location to store the screen that the
cursor is on, or |
[out][allow-none][transfer none] |
x |
location to store root window X coordinate of pointer, or |
[out][allow-none] |
y |
location to store root window Y coordinate of pointer, or |
[out][allow-none] |
mask |
location to store current modifier mask, or |
[out][allow-none] |
Since: 2.2
GList *
cdk_display_list_devices (CdkDisplay *display);
cdk_display_list_devices has been deprecated since version 3.0 and should not be used in newly-written code.
Use cdk_device_manager_list_devices() instead.
Returns the list of available input devices attached to display
.
The list is statically allocated and should not be freed.
Since: 2.2
CdkWindow * cdk_display_get_window_at_pointer (CdkDisplay *display,gint *win_x,gint *win_y);
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 CDK (for example,
belongs to another application).
display |
||
win_x |
return location for x coordinate of the pointer location relative
to the window origin, or |
[out][allow-none] |
win_y |
return location for y coordinate of the pointer location relative
& to the window origin, or |
[out][allow-none] |
Since: 2.2
void cdk_display_warp_pointer (CdkDisplay *display,CdkScreen *screen,gint x,gint 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.
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 CtkColorSelectionDialog.
display |
||
screen |
the screen of |
|
x |
the x coordinate of the destination |
|
y |
the y coordinate of the destination |
Since: 2.8
gboolean
cdk_display_supports_cursor_color (CdkDisplay *display);
Returns TRUE if multicolored cursors are supported
on display
. Otherwise, cursors have only a forground
and a background color.
Since: 2.4
gboolean
cdk_display_supports_cursor_alpha (CdkDisplay *display);
Returns TRUE if cursors can use an 8bit alpha channel
on display
. Otherwise, cursors are restricted to bilevel
alpha (i.e. a mask).
Since: 2.4
guint
cdk_display_get_default_cursor_size (CdkDisplay *display);
Returns the default size to use for cursors on display
.
Since: 2.4
void cdk_display_get_maximal_cursor_size (CdkDisplay *display,guint *width,guint *height);
Gets the maximal size to use for cursors on display
.
display |
||
width |
the return location for the maximal cursor width. |
[out] |
height |
the return location for the maximal cursor height. |
[out] |
Since: 2.4
CdkWindow *
cdk_display_get_default_group (CdkDisplay *display);
Returns the default group leader window for all toplevel windows
on display
. This window is implicitly created by CDK.
See cdk_window_set_group().
Since: 2.4
gboolean
cdk_display_supports_selection_notification
(CdkDisplay *display);
Returns whether CdkEventOwnerChange events will be sent when the owner of a selection changes.
Since: 2.6
gboolean cdk_display_request_selection_notification (CdkDisplay *display,CdkAtom selection);
Request CdkEventOwnerChange events for ownership changes of the selection named by the given atom.
display |
||
selection |
the CdkAtom naming the selection for which ownership change notification is requested |
Since: 2.6
gboolean
cdk_display_supports_clipboard_persistence
(CdkDisplay *display);
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.
Since: 2.6
void cdk_display_store_clipboard (CdkDisplay *display,CdkWindow *clipboard_window,guint32 time_,const CdkAtom *targets,gint n_targets);
Issues a request to the clipboard manager to store the clipboard data. On X11, this is a special program that works according to the FreeDesktop Clipboard Specification.
display |
||
clipboard_window |
a CdkWindow belonging to the clipboard owner |
|
time_ |
a timestamp |
|
targets |
an array of targets
that should be saved, or |
[array length=n_targets][nullable] |
n_targets |
length of the |
Since: 2.6
gboolean
cdk_display_supports_shapes (CdkDisplay *display);
Returns TRUE if cdk_window_shape_combine_mask() can
be used to create shaped windows on display
.
Since: 2.10
gboolean
cdk_display_supports_input_shapes (CdkDisplay *display);
Returns TRUE if cdk_window_input_shape_combine_mask() can
be used to modify the input shape of windows on display
.
Since: 2.10
gboolean
cdk_display_supports_composite (CdkDisplay *display);
Returns TRUE if cdk_window_set_composited() can be used
to redirect drawing on the window using compositing.
Currently this only works on X11 with XComposite and XDamage extensions available.
Since: 2.12
CdkAppLaunchContext *
cdk_display_get_app_launch_context (CdkDisplay *display);
Returns a CdkAppLaunchContext suitable for launching applications on the given display.
a new CdkAppLaunchContext for display
.
Free with g_object_unref() when done.
[transfer full]
Since: 3.0
void cdk_display_notify_startup_complete (CdkDisplay *display,const gchar *startup_id);
Indicates to the GUI environment that the application has finished loading, using a given identifier.
CTK+ will call this function automatically for CtkWindow
with custom startup-notification identifier unless
ctk_window_set_auto_startup_notification() is called to
disable that feature.
display |
||
startup_id |
a startup-notification identifier, for which notification process should be completed |
Since: 3.0
CdkSeat *
cdk_display_get_default_seat (CdkDisplay *display);
Returns the default CdkSeat for this display.
Since: 3.20
GList *
cdk_display_list_seats (CdkDisplay *display);
Returns the list of seats known to display
.
Since: 3.20
int
cdk_display_get_n_monitors (CdkDisplay *display);
Gets the number of monitors that belong to display
.
The returned number is valid until the next emission of the “monitor-added” or “monitor-removed” signal.
Since: 3.22
CdkMonitor * cdk_display_get_monitor (CdkDisplay *display,int monitor_num);
Gets a monitor associated with this display.
the CdkMonitor, or NULL if
monitor_num
is not a valid monitor number.
[nullable][transfer none]
Since: 3.22
CdkMonitor *
cdk_display_get_primary_monitor (CdkDisplay *display);
Gets the primary monitor for the display.
The primary monitor is considered the monitor where the “main desktop” lives. While normal application windows typically allow the window manager to place the windows, specialized desktop applications such as panels should place themselves on the primary monitor.
the primary monitor, or NULL if no primary
monitor is configured by the user.
[nullable][transfer none]
Since: 3.22
CdkMonitor * cdk_display_get_monitor_at_point (CdkDisplay *display,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.
Since: 3.22
CdkMonitor * cdk_display_get_monitor_at_window (CdkDisplay *display,CdkWindow *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.
Since: 3.22
“closed” signalvoid user_function (CdkDisplay *display, gboolean is_error, gpointer user_data)
The ::closed signal is emitted when the connection to the windowing
system for display
is closed.
display |
the object on which the signal is emitted |
|
is_error |
|
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 2.2
“monitor-added” signalvoid user_function (CdkDisplay *display, CdkMonitor *monitor, gpointer user_data)
The ::monitor-added signal is emitted whenever a monitor is added.
display |
the objedct on which the signal is emitted |
|
monitor |
the monitor that was just added |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 3.22
“monitor-removed” signalvoid user_function (CdkDisplay *display, CdkMonitor *monitor, gpointer user_data)
The ::monitor-removed signal is emitted whenever a monitor is removed.
display |
the object on which the signal is emitted |
|
monitor |
the monitor that was just removed |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 3.22
“opened” signalvoid user_function (CdkDisplay *display, gpointer user_data)
The ::opened signal is emitted when the connection to the windowing
system for display
is opened.
display |
the object on which the signal is emitted |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“seat-added” signalvoid user_function (CdkDisplay *display, CdkSeat *seat, gpointer user_data)
The ::seat-added signal is emitted whenever a new seat is made known to the windowing system.
display |
the object on which the signal is emitted |
|
seat |
the seat that was just added |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 3.20
“seat-removed” signalvoid user_function (CdkDisplay *display, CdkSeat *seat, gpointer user_data)
The ::seat-removed signal is emitted whenever a seat is removed by the windowing system.
display |
the object on which the signal is emitted |
|
seat |
the seat that was just removed |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 3.20